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


moonbiter - 2:11 pm on Jul 17, 2002 (gmt 0)


If I click the link (using Opera 6.02 for Linux), I get an empty white page. Guess that's a good example of how not to do it.

He addresses that issue, go figure:

To quote his site:

"However, for the really new scripts this is not enough. Opera 5, for instance, supports enough of the new DOM to do DHTML but not enough to support really advanced scripting. Therefore when you really want to use the new scripting, you should start with this object detect:

"if (document.getElementById && document.createElement)

"This one first checks for the W3C DOM and then for the presence of the crucial createElement() method. If it isn't supported the browser is not sufficiently advanced for true W3C DOM scripting. Explorer 4 supports document.createElement too (though it works differently from the W3C method), but we don't want it to execute the scripts. Therefore we also have to check for getElementById.

"Unfortunately this object detect, too, is not enough. Opera 6 says it supports createElement though it cannot actually add the created element to the document. At the moment I don’t know what to do about it. I hope Opera will either remove support for createElement or add support for actually doing something with the element."


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