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

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 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.
问题解决了。我们必须在 dojo.xd.js 的“registerModule”中给出本地路径。然后 JS 将从我们在 registerModule 中给出的位置获取。
例如:
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: