开发者

DOJO include files a directory back

开发者 https://www.devze.com 2023-03-14 08:07 出处:网络
I have dojo files in resources/js/dojo1.6/dojo/dojo.js I have another file here resources/js/pages/file1.js

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

精彩评论

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