General Community > Scripting Help

JS cross browser compatability?

(1/1)

Curbow 5:
the way i understand, it works like this:


--- Code: ---if (document.getElementById) {
   // do stuff in all browsers
}
else if (document.all) {
   // do stuff in IE4
}
--- End code ---

is this correct or are there other issues i should direct my attention to?

[Unknown]:
Personally, I hate that way of doing things.  It's kludgey - imho.

Look at some of the javascript here - it works on IE 4.0, Mozilla, and Opera 7. (and that's only because 6 doesn't support reflow, otherwise it would.)

But... most things aren't an issue.  The biggest things are events, changing the html of an element, (DOM2.) and the like.  If you don't go into that stuff you'll be fine - even with Opera 6.

-[Unknown]

Navigation

[0] Message Index

Go to full version