js动态加载js文件
try{
function __loadJs(jsFile,callBack){
var new_element = document.createElement("script");
new_element.setAttribute("type", "text/javascript");
new_element.setAttribute("src", jsFile);
document.head.appendChild(new_element);
new_element.onload=function(){
if(typeof callBack == "function"){
callBack();
//test2();
}
}
}
//引入js
__loadJs('http://my.test.com/test2.js');
__loadJs('http://my.test.com/test2.js',function(){ test2();});
}catch(e){
alert("js加载失败"+e);
}

浙公网安备 33010602011771号