Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- JavaScript: Check for features instead of browsers (user agents)!


starway - 8:55 am on Jul 18, 2002 (gmt 0)


>>document.all is supported in MSIE 4+, Opera 6, iCab, and Omniweb.

One correction: Opera "understands" document.all only when it's identification is set to IE5.

But it handles getElementById perfectly! So I'd like to tell that joshie76's code should be commented as this:
[1]

if (document.all)
{
IE4 code
}
else if (document.layers)
{
NN4 code
}
else if (document.getElementById)
{
code for standard-compliant browsers: Mozilla/N6, Opera5+, IE5+, ...
}

[/1]

I think that this part:
if (document.all && document.getElementById)
{
IE5+ code
}

is useless as all above listed variants cover all browsers you can find.


Thread source:: http://www.webmasterworld.com/javascript/157.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com