You also need to modify djConfig.baseUrl . The module file path is a combination of djConfig.baseUrl and the module path if the relative path is used in the module path. See the example below.
<script type="text/javascript"> var djConfig = { baseUrl : "./", modulePaths : {"example" : "js/example"} }; </script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.0/dojo/dojo.xd.js "></script> <script type="text/javascript"> (function() { dojo.require("example.Sample"); dojo.addOnLoad(function() { new example.Sample().sayHello(); }); })(); </script>
More information can be found at Cross-Domain Dojo .
source share