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).
July 19th, 2006 at 3:06 pm
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…
July 19th, 2006 at 4:34 pm
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??
July 19th, 2006 at 4:47 pm
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!
November 14th, 2006 at 11:46 pm
excellent!
…i remember running into this before, forgot what the solution was.
April 9th, 2008 at 8:24 pm
Hello Benjamin,
ElementReference.getAttribute(“class”)
now works as expected and correctly in IE 8 beta 1.
Regards, Gérard