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:
Having many different scripts, some of them loaded using a wrapper and others loaded as just regular scripts like on this HTML:
<script type="text/javascript" src="/path/script1.js"></script>
<script type="text/javascript" src="/path/script2.js"></script>
<script type="text/javascript">wrapper.get('/path/script3.js');</script>
<script type="text/javascript">wrapper.get('/path/script4.js');</script>
<script type="text/javascript" src="/path/script5.js"></script>
<script type="text/javascript" src="/path/script6.js"></script>
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:
jQuery.ajax({
url: 'url of the script',
dataType: 'script',
cache: 'true',
async: false
});
The above scripts will load in this order:
- script1
- script2
- script5
- script6
- script3
- script4
So I would like to know if there is something I could do in the 'get' method of the wrapper to download them as:
- script1
- script2
- script3
- script4
- script5
- script6
Thanks in advance!