开发者

DOJO include files a directory back

I have dojo files in resources/js/dojo1.6/dojo/dojo.js

I have another file here resources/js/pages/file1.js

This file requires another file which is located at resources/js/folder/file2.js

This is how I am including it dojo.require('folder.file2');

So these three folder are in hirarchy

dojo1.6, pages and f开发者_JAVA技巧older

When I run application

I got the following error

File not found: /resources/js/dojo1.6/folder/file2.js

How can I overcome this error.


You need to tell Dojo where your modules can be found, relative to dojo.js, using dojo.registerModulePath:

dojo.registerModulePath("pages", "../../pages");
dojo.registerModulePath("folder", "../../folder");

See http://dojotoolkit.org/reference-guide/dojo/registerModulePath.html for a more detailed explanation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜