dojo.registerModulePath
<script src="../../js/dojo.js"></script>
defined in dojo/_base/_loader/loader.js
An unregistered module is given the default path of ../[module], relative to Dojo root. For example, module acme is mapped to ../acme. If you want to use a different module name, use dojo.registerModulePath.
parameter | type | description |
---|---|---|
module | String | |
prefix | String |
Examples
Example 1
If your dojo.js is located at this location in the web root:
/myapp/js/dojo/dojo/dojo.js
and your modules are located at:
/myapp/js/foo/bar.js
/myapp/js/foo/baz.js
/myapp/js/foo/thud/xyzzy.js
Your application can tell Dojo to locate the "foo" namespace by calling:
dojo.registerModulePath("foo", "../../foo");
At which point you can then use dojo.require() to load the modules (assuming they provide() the same things which are required). The full code might be: