如何在多个 ASP.Net 站点之间共享 TinyMCE Javascript 源代码

发布于 2024-12-11 12:02:46 字数 822 浏览 0 评论 0原文

我使用 Moxie code TinyMCE 文本编辑器 (http://www.tinymce.com/) 来获取内容进入多个网站。目前,我在每个站点的文件夹中都有tiny_mce 文件夹。这意味着我有很多相同 .js 文件的副本。

我认为最好拥有一个tiny_mce文件夹的副本并为每个站点引用它 - 因此如果我进行更改或升级tiny_mce我只需要做一次。另外,如果我创建一个新站点,我可以引用同一个站点,从而无需将另外 9Mb 的重复文件上传或复制到服务器上。

我尝试将tiny_mce放入各个网站之外的文件夹中,并将其设置为本地主机上他们可以看到的网站。

然后,我包含来自每个站点的 javascript,如下所示:

<script type="text/javascript" src="http://localhost/MCE/tiny_mce/tiny_mce.js"></script>

我很确定该站点可以找到该文件 - 我已经使用简单的 javascript 警报框测试进行了测试,效果很好 - 如果我“查看源代码”并检查通过它使用的链接,我可以访问 tiny_mce.js 文件 - 这是正确的文件。

但是,tiny_mce 不起作用。

我猜测有某种我不知道的依赖项或配置导致了问题,但我不确定从哪里开始找出不起作用的内容。 (我没有收到任何错误,它只是不加载tiny_mce)

有没有人设法让tiny_mce在多个站点之间共享其源文件? tiny_mce 是否需要 .js 文件位于网站的根文件夹内才能正常工作?

I'm using the Moxie code TinyMCE text editor (http://www.tinymce.com/) for content entry on a number of sites. At the moment I have the tiny_mce folder sitting in the folder of each site. This means that I have lots of copies of the same .js files.

I think it would be better to have one copy of the tiny_mce folder and reference it for each site - so if I make a change, or upgrade the tiny_mce I only have to do it once. Also, if I make a new site I can reference the same one to save needing to upload or copy another 9Mb of duplicated files onto the server.

I have tried putting the tiny_mce into a folder outside the individual websites and setting it up as a site on localhost that they can see.

I then include the javascript from each site like this:

<script type="text/javascript" src="http://localhost/MCE/tiny_mce/tiny_mce.js"></script>

I'm pretty sure the the file can be found by the site - I've tested with a simple javascript alert box test which works fine - and if I "View Source" and check the link it's using, I can access the tiny_mce.js file - which is the correct file.

However, the tiny_mce doesn't work.

I'm guessing there are some kind of dependencies or configurations that I'm not aware of that are causing a problem, but I'm not sure quite where to start to find out what isn't working. (I don't get any errors, it just doesn't load the tiny_mce)

Has anyone managed to get tiny_mce to share it's source files across multiple sites? Does tiny_mce require the .js files to be inside the root folder of the site in order to work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嘿哥们儿 2024-12-18 12:02:46

有没有人设法让tiny_mce来共享它的源文件
多个站点?

我还没试过。

tiny_mce 是否要求 .js 文件位于以下目录的根文件夹内
该网站才能正常工作?

否。

根据您的服务器系统,如果您的不同网站文件存储在一台物理服务器设备上,您可以使用硬链接或软链接到共享的tiny_mce_folder(也应该可以从网络访问)。

Has anyone managed to get tiny_mce to share it's source files across
multiple sites?

I have not tried it yet.

Does tiny_mce require the .js files to be inside the root folder of
the site in order to work?

No.

Depending on your server system and in case your different website files are stored on one physical server device you could use a hardlink or softlink to the shared tiny_mce_folder (which should be accessible from the net too).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文