Thursday, August 18, 2005

Differences between Mozilla and Internet Explorer

Some time ago I read an article pointing out how to migrate apps from Internet Explorer to Mozilla. The articule is well written and worth a read, but it falls short on explaining all the real problems you can find when making a webapplication that works on both browsers (let alone something that works on Opera, Safari and Konqueror).

So I decided to blog about some of the inconsistencies that I've run into.

For this first post, one of my favorites, innerHTML support depends on your browser.

innerHTML is not part of any blessed W3C standard, it was introduced a long time ago in Internet Explorer. It's so damn useful and so handy compared to using the DOM interfaces that this property was replicated by other browsers.

There is however a difference that you must be aware of, in Internet Explorer you can not change innerHTML on objects of type COL, COLGROUP, FRAMESET, HTML, STYLE, TABLE, TBODY, TFOOT, THEAD, TITLE or TR. You can do it in Firefox.

If you develop a site looking first how it works on Firefox and fixing it later in explorer, you may fall on this trap, thinking that everything is working ok, just to see that it's not working at all when you check it later in explorer.

If you want to support several browsers, better do it from the front up, or there may be some design decisions that may be hard to overcome when you discover that this or that trick doesn't work on one of your browsers.