views:

706

answers:

2

Is there a list online somewhere of IE8 changes that might break existing JavaScript code?

We have a few clients which we developed a few different apps for using jQuery, YUI and some pure JavaScript. All have problems after upgrading their browsers to IE8. The jQuery display we did won't show. Tabs in YUI won't work. And table.deleteRow in JavaScript doesn't seem to work anymore.

Links to individual issues and fixes would also help. Thanks.

+1  A: 

In my experience, IE8 would break my JavaScript in a few selected places. After a few hours of Bugsearch, I found out that an HTML id cannot be the same as a function name.

For Instance:

<div id="addToCart">foobar</div>

and

function addToCart {
   //Spy sappin' mah function!
}

In this Example, the function addToCart would break because the div has the same name as the function. I have yet to find an explanation for this.

Note

This is a personal Observation. Could other developers confirm this for me?

Mike
Yes, IE creates (or at least behaves as if it does) global properties corresponding to ID's and NAME's of elements in a document. I don't think these names shadow names of global function (or variable) declarations, so I'm not sure how your function would "break". The only way it might cause problems is if you try to assign to such property - IIRC, IE simply throws error. And of course it goes without saying that you shouldn't rely on this "magic" element resolution; instead, elements should be accessed with standard methods, such as `document.getElementById`.
kangax
+2  A: 

Microsoft released Internet Explorer 8 Readiness Toolkit which gives a pretty good overview of IE8 changes. In particular, check DOM improvements - changes in getAttribute is a common source of incompatibilities.

Resig also blogged about some of IE8 changes.

For a list of known IE8 bugs, check Web Bug Track and a compilation by gtalbot.org

kangax