Say I have the following array:
var array=['script1.js', 'script2.js','script3.js','script1.js']
How can I run through that array loading in each script one by one with the next one only being called after the previous one has been fully loaded and fired?
I wish to use JQuery's getScript function.
Would something like this suffice?
var i=0;
var id_key='file'+i;
function load_script(url){
$.getScript(url)
.done(i++; load_script(array[i]);
}
$.getScript(url,function(){//load next});