Willem Odendaal

the coder's point of view

<October 2008>
SuMoTuWeThFrSa
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678


Navigation

I Read

Subscriptions

Post Categories



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 on Tuesday, January 25, 2005 12:33 AM by willemo





Powered by Dot Net Junkies, by Telligent Systems