/*
* 动态加载JS文件
* jsFile : JS文件路径
* funOnLoad : JS文件加载完毕后要执行的函数
*/
function LoadJS(jsFile,funOnLoad){
if(!document.getElementById(jsFile)){
var head = document.getElementsByTagName('HEAD').item(0);
var script = document.createElement('SCRIPT');
script.id = "'"+jsFile+"'";
script.src = jsFile;
script.type = "text/javascript";
head.appendChild(script);
if(funOnLoad != null){
script.onreadystatechange = function(){
if(script.readyState=="complete"){
funOnLoad();
}
}
}
}else if(funOnLoad != null){
funOnLoad();
}
}
* 动态加载JS文件
* jsFile : JS文件路径
* funOnLoad : JS文件加载完毕后要执行的函数
*/
function LoadJS(jsFile,funOnLoad){
if(!document.getElementById(jsFile)){
var head = document.getElementsByTagName('HEAD').item(0);
var script = document.createElement('SCRIPT');
script.id = "'"+jsFile+"'";
script.src = jsFile;
script.type = "text/javascript";
head.appendChild(script);
if(funOnLoad != null){
script.onreadystatechange = function(){
if(script.readyState=="complete"){
funOnLoad();
}
}
}
}else if(funOnLoad != null){
funOnLoad();
}
}