How do I load a variable number of scripts with jQuery.getScript() before running javascript code?
<p>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 getScript() method allows one script to be loaded - how could I use it to load x number of scripts before running its inner code?</p>

<pre>$.getScript("test.js", function(){
    // code to run after script is loaded
});</pre>

<p>What I need:</p>

<pre>$.getScript(new Array("1.js","2.js"), function(){
    // code to run after all scripts are loaded
});</pre>

<p>Thanks</p>
