javascript - How to get dojo module path from inside of a widget -
i have dojoconfig below:
var base = location.href.split("/"); base.pop(); base = base.join("/"); var dojoconfig = { async: true, parseonload: false, isdebug: false, packages: [{ name: "library", location: base + '/js/lib' }, { name: 'widgets', location: base + '/js/widgets' }];
how access location
of widgets
inside of loaded module or widget?
so official site, dojo/require
that.
here example:
require(["dojo/_base/xhr", "dojo/dom"], function(xhr, dom){ // points $dojoroot/dijit/form/tests/testfile.html var url = require.tourl("dijit/form/tests/testfile.html"); xhr.get({ url: url, load: function(html){ dom.byid("foo").innerhtml = html; } }); });
Comments
Post a Comment