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

July 2013
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Search