(
function
() {
var
obj = {};
obj.loadScript =
function
(url,callback){
var
doc = document;
var
script = doc.createElement(
"script"
);
script.type =
"text/javascript"
;
if
(script.readyState){
script.onreadystatechange =
function
(){
if
(script.readyState==
"load"
||script.readyState==
"complete"
){
script.onreadystatechange =
null
;
callback();
}
};
}
else
{
script.onload =
function
(){
callback();
};
}
script.src = url;
doc.getElementsByTagName(
"head"
)[0].appendChild(script);
};
var
jsList = [
"js1.js"
,
"js2.js"
];
function
callback(){
jsList.length?obj.loadScript(jsList.shift(),callback)
:(
function
(){time =
null
})();
}
var
time = setTimeout(
function
(){obj.loadScript(jsList.shift(),callback)},25);
})();
只需要更改jsList就可以了