The code is as follows:
var otherJScipt = document.createElement("script ");
otherJScipt = document.createElement("script");
otherJScipt.setAttribute("type", "text/javascript");
otherJScipt.setAttribute("src", "/xxx. js");
document.getElementsByTagName("head")[0].appendChild(otherJScipt);//Append to the head tag
//Judge the server
if (navigator .userAgent.indexOf("IE") >= 0) {
//Events under IE
otherJScipt.onreadystatechange = function () {
//Judgment under IE to determine whether loading is complete
if (otherJScipt && (otherJScipt.readyState == "loaded" || otherJScipt.readyState == "complete")) {
otherJScipt.onreadystatechange = null;
callMyFun();
}
};
}
else {
otherJScipt.onload = function () {
otherJScipt.onload = null;
callMyFun();
};
}