DOJO 没有互联网连接

发布于 2024-12-24 18:33:22 字数 333 浏览 1 评论 0原文

我需要使用 DOJO 构建一个 Intranet 站点。即使没有互联网连接,用户也应该能够使用该网站。但是当我使用 dojo.require("dojox.widget.AutoRotator"); 时,它会从 ajax.googleapis.com 获取 JS 文件。有什么办法可以避免这种情况吗?我为 dojo.js 指定了本地位置:

I require to build an intranet site using DOJO. The user should be able to use the site even without internet connection. But when I use dojo.require("dojox.widget.AutoRotator"); it is fetching the JS files from ajax.googleapis.com. Is there any way to avoid this. I specified a local location for dojo.js:
<script type="text/javascript" src="/dojo/dojo.js">, but AutoRotator.js is not getting fetched from this location. It is fetching from internet.

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

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

发布评论

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

评论(2

相思碎 2024-12-31 18:33:22

如果您使用 Dojo 的 CDN 托管版本,那么当您 dojo.require 任何内容时,它会拉取它。

如果您想避免这种情况,那么您应该创建一个构建,或者在本地托管您自己的 Dojo 版本。

If you use a CDN hosted version of Dojo, then when you dojo.require anything, it pulls it.

If you want to avoid this, then you should create a build, or host your own version of Dojo locally.

又爬满兰若 2024-12-31 18:33:22

问题解决了。我们必须在 dojo.xd.js 的“registerModule”中给出本地路径。然后 JS 将从我们在 registerModule 中给出的位置获取。

例如:

dojo.registerModulePath("dojo","/portal_dojo/dojo");

dojo.registerModulePath("dijit","/portal_dojo/dijit");

dojo.registerModulePath("dojox","/portal_dojo/dojox");

Problem solved. We have to give local path in "registerModule" of dojo.xd.js. Then JS will get picked up from the location which we give in registerModule.

Eg:

dojo.registerModulePath("dojo","/portal_dojo/dojo");

dojo.registerModulePath("dijit","/portal_dojo/dijit");

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