Javascript script tag load dynamically into html head
<p>Calling this function:</p>

<pre><code>function agLoadScripts(arrayOfScripts) {
    // Scripts are added to the head
    for(var i=0; i &lt; arrayOfScripts.length; i++) {
        var script  = document.createElement('script');
        script.type = 'text/javascript';
        script.src = arrayOfScripts[i][0];
        if(arrayOfScripts[i][1]) { script.id = arrayOfScripts[i][1]; }
        document.head.appendChild(script);
    }
}
</code></pre>

<p>continuesly gives in firebug </p>

<pre><code>attempt to run compile-and-go script on a cleared scope
agLoadScripts(arrayOfScripts=[["http://ajax.googleapis....ery/1.6.4/jquery.min.js", agJQueryLoadTag"]])scratc...?268250 (line 126)
everything(config=Object { enabled=true, random=268250, clickurl=[2]})scratc...?268250    (line 34)
onload()scratchconfig.js (line 24)
[Break On This Error]   
document.head.appendChild(script);
</code></pre>

<p>If you can help me please to head a direction to solve it or a clue to understand what horror im making I will mark the question as solved :), have been 3 hours already struggling to have it fixed, thanks</p>

<p>EDIT.</p>

<p>Found out was stupid error on my side, was calling the function without the 2d array second argument. my bad :(, all is good now</p>
