I have a javascript widget that is included in the page by inserting a single script tag (since the application should be easily distributed):
<script type="text/javascript" src="loadMyWidget.js"></script>
loadMyWidget.js then you need to load several script files that must be executed in a specific sequence. I tried loading them async by inserting elements into the DOM script, but that does not give me control over the sequence.
I also tried using head.js, which works great for modern browsers, but I can't get it to work in IE7 and 8.
Minimizing scripts into a single file, unfortunately, is difficult, since it consists of several files from different projects, and I do not know when to update the script.
Anyway, I need to download javascript files from javascript code in a specific sequence and make it work in all browsers, including IE7 and 8.
source share