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

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -