我在 index.html 中有这个 super 简单的代码
<script src="../../dojo/dojo.js"></script>
<script>
dojo.require("dojo.fx");
dojo.ready(function(){
dojo.byId("greeting").innerHTML += ", from " + dojo.version;
dojo.fx.slideTo({
top: 100,
left: 200,
node: dojo.byId("greeting")
}).play();
});
</script>
我收到错误 错误:无法加载“dojo.fx”;最后尝试 './fx.js'
注意:我没有更改 dojo 的目录结构。我正在使用 dojo 1.6
-dojo
-dijit
-dojox
-labs
-ex01
-index.html
最佳答案
问题是 dojo 根本无法从我的本地文件系统运行。
Run your source code from a web server, not the file system, even if the web server is running on your development machine. The browser's handling of HTTP requests from the local file system are more restrictive than from a web server, even when it's running in the same machine. For consistent results, you should always run Dojo from within any HTTP web server (Apache, nginx, Tomcat, IIS, Jetty, etc.).
关于javascript - 错误 : Could not load module in dojo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14079549/