Originally Posted by
Verminox
Generally, all Javascript code should work with IE's JScript implementation (with minor exceptions).
I suppose it depends on your definition of "generally", but you may want to note that specifically event handlers, and DOM modifications (especially those inside the 'style tree') are anything but portable.
For instance, if you want to look up properties about an event e; Spidermonkey (the JavaScript engine used by Firefox) will generally provide you with a different interface from that of the engine in MSIE. This starts at the very bottom level of where to fetch/point to your copy of the event from:
Code:
function simpleExample(e) {
e = e /* other browsers simply dispatch an event */ || window.event; /* MS IE does it different ... <_< */
return e;
}
Such a function is required with DHTML when you want to process events such as "onclick" or "onmouseup", at least if you want to keep your code portable. But this function clearly demonstrates (one of the many, but this one is probably the prime example of what any aspiring web developer will 'really feel' first).
Also: did you link to the Mozilla guides regarding their JavaScript engine? Those are absolute lifesavers!
http://developer.mozilla.org/en/docs/SpiderMonkey
Bookmarks