如何将本机 javascript 添加到 中$.when
?当我想为每个 inside 使用时,我在下面执行此操作时出现错误$.when
。有任何想法吗?
var scripts = [
"ccommon.js",
"ccommon2.js",
"ccommon3.js"
];
$.when(
// Via $.getScript.
for(var i = 0; i < scripts.length; i++) {
$.getScript(scripts[i]);
}
).done(function(){
//place your code here, the scripts are all loaded.
alert('script loaded');
});