dojo » _xdResourceLoaded
dojo._xdResourceLoaded
<script src="../../js/dojo.js"></script>
defined in dojo/_base/_loader/loader_xd.js
Internal xd loader function. Called by an xd module resource when it has been loaded via a script tag.
Usage
function (/*Object*/ res) (view source)
var deps = res.depends; var requireList = null; var requireAfterList = null; var provideList = []; if(deps && deps.length > 0){ var dep = null; var insertHint = 0; var attachedResource = false; for(var i = 0; i < deps.length; i++){ dep = deps[i]; //Look for specific dependency indicators. if (dep[0] == "provide"){ provideList.push(dep[1]); }else{ if(!requireList){ requireList = []; } if(!requireAfterList){ requireAfterList = []; } var unpackedDeps = this._xdUnpackDependency(dep); if(unpackedDeps.requires){ requireList = requireList.concat(unpackedDeps.requires); } if(unpackedDeps.requiresAfter){ requireAfterList = requireAfterList.concat(unpackedDeps.requiresAfter); } } //Call the dependency indicator to allow for the normal dojo setup. //Only allow for one dot reference, for the i18n._preloadLocalizations calls //(and maybe future, one-dot things). var depType = dep[0]; var objPath = depType.split("."); if(objPath.length == 2){ dojo[objPath[0]][objPath[1]].apply(dojo[objPath[0]], dep.slice(1)); }else{ dojo[depType].apply(dojo, dep.slice(1)); } } //If loading the debugAtAllCosts module, eval it right away since we need //its functions to properly load the other modules. if(provideList.length == 1 && provideList[0] == "dojo._base._loader.loader_debug"){ res.defineResource(dojo); }else{ //Save off the resource contents for definition later. var contentIndex = this._xdContents.push({ content: res.defineResource, resourceName: res["resourceName"], resourcePath: res["resourcePath"], isDefined: false }) - 1; //Add provide/requires to dependency map. for(var i = 0; i < provideList.length; i++){ this._xdDepMap[provideList[i]] = { requires: requireList, requiresAfter: requireAfterList, contentIndex: contentIndex }; } } //Now update the inflight status for any provided resources in this loaded resource. //Do this at the very end (in a *separate* for loop) to avoid shutting down the //inflight timer check too soon. for(var i = 0; i < provideList.length; i++){ this._xdInFlight[provideList[i]] = false; } }
parameter | type | description |
---|---|---|
res | Object |