Changeset 12289

Show
Ignore:
Timestamp:
02/05/08 07:37:15 (11 months ago)
Author:
alex
Message:

expand docs for registerModulePath(). Refs #4820

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/_base/_loader/loader.js

    r12237 r12289  
    410410                //              ../acme.  If you want to use a different module name, use 
    411411                //              dojo.registerModulePath.  
     412                //      example: 
     413                //              If your dojo.js is located at this location in the web root: 
     414                //      |       /myapp/js/dojo/dojo/dojo.js 
     415                //              and your modules are located at: 
     416                //      |       /myapp/js/foo/bar.js 
     417                //      |       /myapp/js/foo/baz.js 
     418                //      |       /myapp/js/foo/thud/xyzzy.js 
     419                //              Your application can tell Dojo to locate the "foo" namespace by calling: 
     420                //      |       dojo.registerModulePath("foo", "../../foo"); 
     421                //              At which point you can then use dojo.require() to load the 
     422                //              modules (assuming they provide() the same things which are 
     423                //              required). The full code might be: 
     424                //      |       <script type="text/javascript"  
     425                //      |               src="/myapp/js/dojo/dojo/dojo.js"></script> 
     426                //      |       <script type="text/javascript"> 
     427                //      |               dojo.registerModulePath("foo", "../../foo"); 
     428                //      |               dojo.require("foo.bar"); 
     429                //      |               dojo.require("foo.baz"); 
     430                //      |               dojo.require("foo.thud.xyzzy"); 
     431                //      |       </script> 
    412432                d._modulePrefixes[module] = { name: module, value: prefix }; 
    413433        }