Thursday, March 27, 2008

IE Problems with Javascript

Most faced errors in IE (6 or 7):

1. “Error: Expected identifier, string or number in IE”

If working javascript in firefox start throwing above error, then you have forgotten to remove the comma at end of the function. More info

2. The “setAttribute” function does not work correctly in IE.
Instead of object.setAttribute("size", length), use object.size = length;

3. If object is not already within the table, IE returns 'null' when you call object.insertRow() or object.insertCell()
More info