Pause page load using javascript
<p>I would like to know if it's possible to pause the page processing till a certain script resource is loaded. But this is the complete picture:</p>

<p>Having many different scripts, some of them loaded using a wrapper and others loaded as just regular scripts like on this HTML:</p>

<pre><code>&lt;script type="text/javascript" src="/path/script1.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/path/script2.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;wrapper.get('/path/script3.js');&lt;/script&gt;
&lt;script type="text/javascript"&gt;wrapper.get('/path/script4.js');&lt;/script&gt;
&lt;script type="text/javascript" src="/path/script5.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/path/script6.js"&gt;&lt;/script&gt;
</code></pre>

<p>The scripts loaded using a wrapper are always downloaded AFTER all the regular scripts are ready. At least this is what I'm experiencing on Firefox 18. The 'get' method of the wrapper does this to download the resources:</p>

<pre><code>jQuery.ajax({
    url: 'url of the script',
    dataType: 'script',
    cache: 'true',
    async: false
});
</code></pre>

<p>The above scripts will load in this order:</p>

<ol>
<li>script1</li>
<li>script2</li>
<li>script5</li>
<li>script6</li>
<li>script3</li>
<li>script4</li>
</ol>

<p>So I would like to know if there is something I could do in the 'get' method of the wrapper to download them as:</p>

<ol>
<li>script1</li>
<li>script2</li>
<li>script3</li>
<li>script4</li>
<li>script5</li>
<li>script6</li>
</ol>

<p>Thanks in advance!</p>
