I’m trying to work out how to load a module using example http://dojotoolkit.org/reference-guide/dojo/registerModulePath.html
I have the following structure (highlighting what I believe to be the important files):
/index.html (code below)
/dojo-1.6.1/dojo/dojo.js
/dojo-1.6.1/j_test/test1234.js <- for method 1 loading
/xj_test/test1234.js <- for method 2 loading
I have the following code on the page:
<script type="text/javascript" src="/dojo-1.6.1/dojo/dojo.js"></script>
<script type="text/javascript">
dojo.ready(function(){
//alert("Dojo version " + dojo.version");
//method 1
dojo.require("j_test.test1234");
//method2
dojo.registerModulePath("xj_test", "../../xj_test");
dojo.require("xj_test.test1234");
});
</script>
For method 1 I get the error message:
could not load ‘j_test.test1234’; last tried ‘../j_test/test1234.js’
For method 2, I get the error:
Could not load ‘xj_test.test1234’; last tried ‘../../xj_test/test1234.js’
I was expecting dojo to work out the correct path auto-magically but I guess I must be missing something? I am using dojo1.6.1
Did you remember to put the
dojo.providecall intest1234.js?Dojo 1.7 has a brand new and awesomer module system. Are you sure you don’t want that instead? 🙂