js动态加载以及确定加载完成的代码

网络编程 发布日期:2024/10/12 浏览次数:1

正在浏览:js动态加载以及确定加载完成的代码
代码如下:
复制代码 代码如下:
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);//追加到head标签内


//判断服务器
if (navigator.userAgent.indexOf("IE") >= 0) {
//IE下的事件
otherJScipt.onreadystatechange = function () {
//IE下的判断,判断是否加载完成
if (otherJScipt && (otherJScipt.readyState == "loaded" || otherJScipt.readyState == "complete")) {
otherJScipt.onreadystatechange = null;
callMyFun();
}
};
}
else {
otherJScipt.onload = function () {
otherJScipt.onload = null;
callMyFun();
};
}
微软与英特尔等合作伙伴联合定义“AI PC”:键盘需配有Copilot物理按键
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。