Blog Fixed in IE

It turns out that my homepage was quite unintentionally blank in IE (and in trunk builds of Firefox). I had an unclosed <script> tag in the header, and IE went ahead and parsed the rest of the page as script… and we changed Firefox trunk to match that behavior. Anyway, that error is fixed, as well as a workaround for a bug in IE where element.getAttribute(“class”) always returns null (workaround: use element.className).

Atom Feed for Comments 5 Responses to “Blog Fixed in IE”

  1. Lee Says:

    Heh. I once left a title tag open, with similar effects. I did wonder why Opera decided to put the title as part of the page…

  2. Jed Says:

    Ben, could you explain the ‘workaround’ a bit more, or maybe link the the bug?
    Does that mean in gecko starting 1.9 element.getAttribute(”class”) will always returns null??

  3. Benjamin Smedberg Says:

    Jed, there were two bugs:

    1) I had an unclosed <script> tag. Older Firefoxen used to deal with this fine, but we changed Firefox to more closely match the IE parsing of unclosed <script> tags (arguably a more correct behavior).

    2) I was using .getAttribute(“class”). This is perfectly valid script that should work everywhere, but doesn’t in IE. I fixed my website to use .className instead, which works in both browsers. We’re certainly not going to match IE’s bug in Firefox!

  4. Anthony Ettinger Says:

    excellent!

    …i remember running into this before, forgot what the solution was.

  5. Gérard Talbot Says:

    Hello Benjamin,

    ElementReference.getAttribute(“class”)
    now works as expected and correctly in IE 8 beta 1.

    Regards, Gérard

Leave a Reply