In addition to my previous post about JavaScript behavior difference between Firefox and IE, here are two more:
1. If JavaScript attempts to access HTML before IE finished loading it, you might get “Operation aborted” error. Firefox appears to be very flexible on this and will execute such JavaScript without error. To work around this error, delay the access until onDOMReady or window.onload event fired. Here is another blog entry on this topic.
2. You can load the following JavaScript in Firefox if myObjectType constructor exists and works.
a = new myObjectType();
However IE does not like the code if variable a is not declared earlier and will not stop complaining until you add the declaration. Here is one way to do it.
var a; a = new myObjectType();
This is one difference that I actually prefer IE’s behavior, so I know a bad syntax exists in the code and fix it before it leads to other unintended consequences.
