MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / inputScript

Function inputScript

examples/js/localization.js:106–123  ·  view source on GitHub ↗
(url, callback)

Source from the content-addressed store, hash-verified

104
105 //插入script
106 function inputScript(url, callback) {
107 var script = document.createElement("script");
108 script.type = "text/javascript";
109 if (script.readyState) { //for IE
110 script.onreadystatechange = function () {
111 if (script.readyState === "loaded" || script.readyState === "complete") {
112 script.onreadystatechange = null;
113 callback && callback();
114 }
115 };
116 } else { //for Others
117 script.onload = function () {
118 callback && callback();
119 };
120 }
121 script.src = url;
122 targetScript.parentElement.insertBefore(script, targetScript);
123 }
124
125 nameSpace.initializeI18N = initializeI18N;
126 nameSpace.localize = localize;

Callers 1

initializeI18NFunction · 0.70

Calls 2

createElementMethod · 0.80
callbackFunction · 0.50

Tested by

no test coverage detected