February 11, 2010
Internet Explorer 8 Script Load Order
I discovered some strange IE8 behavior when loading external scripts. Typically, I list a sequence of scripts in their dependency order. For example, if b.js depends upon a.js, I would list them as follows:
<script src="a.js" type="text/javascript" language="JavaScript" defer="defer"></script>
<script src="b.js" type="text/javascript" language="JavaScript" defer="defer"></script>
In Firefox, Safari, and IE7 this works just fine. However in IE8, it seems as though b.js gets loaded before a.js. This left me in a bit of a pickle, because I'm not sure listing b.js before a.js wouldn't break non-IE8 browsers. The solution I finally decided upon was to merge a.js and b.js into a single JavaScript file. Not the ideal solution, but it works.
Posted by josuah at February 11, 2010 2:28 AM UTC+00:00
Trackback Pings
TrackBack URL for this entry:
http://www.wesman.net/cgi-bin/mt/mt-tb.cgi/1585
Comments
Post a comment
Thanks for signing in, . Now you can comment. (sign out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)