1
First read this on the load of AMD modules used by dojo now:
http://requirejs.org/docs/whyamd.html#definition
the way AMD works is that it will return the required module as a function parameter. You can use that module inside the function of your require call.
Let’s say you have defined your foo/bar module. you can use it in the require like that:
require(["foo/bar"], function (anyVarName) { // <- anyVarName will be your foo/bar return value
console.dir(anyVarName);
}
anyVarName will only exist inside the function. Your code using it should be inside it.
you can require multiple modules and they will be passed as parameter in the same order as you require them
require(["foo/bar1","foo/bar2","foo/bar3"], function (bar1, bar2, bar3) {});
is that better ?
Source:stackexchange.com