I need to load a variable number of javascript source files before running javascript code that depends on them. Sometimes 1 script needs to be loaded, other times 2. The ge
If you are using jquery 1.5 you can use the new deferred syntax.
$.when( $.getScript("1.js"), $.getScript("2.js"), $.getScript("3.js") ).then(function(){ alert("all loaded"); });
Just pass in the scripts you wish to load.