Willem Odendaal

the coder's point of view

<July 2008>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789


Navigation

I Read

Subscriptions

Post Categories



Tuesday, January 25, 2005 - Posts

Writing FireFox compatible code

There's more to making your web code FireFox/Mozilla compatible than just changing your 'document.all' to 'document.getElementById'. That's what I though as well. Unfortunately there's a bit more to it. Here's what I've discovered so far...

1. Don't use element.innerText. Rather use element.innerHTML. It works for IE and FireFox.
2. When hooking up onclick events in your HTML, the following used to work in IE 'onclick="HandleClick()'. If you actually want to use the event object, in FireFox, you need to explicitly include the event object as a parameter - 'onclick="HandleClick(event)'.

The only thing left to figure out now is why element.parentElement doesn't seem to be working in my code. Maybe it's just my bug, or maybe it's another Mozilla quirk.

I didn't study web development. Most of my html, css and javascript knowledge comes from experimentation and reading articles on the net. The result - I've been writing Internet Explorer code. Now actually writing web standard code is a royal pain. Wish I started right from the beginning.


 

posted Tuesday, January 25, 2005 12:33 AM by willemo




Powered by Dot Net Junkies, by Telligent Systems