In article <[EMAIL PROTECTED]>, Gervase Markham <[EMAIL PROTECTED]> wrote:
> > Unfortunately, even mozilla.org suggests to use such browser > > dependent code (see > > http://mozilla.org/docs/web-developer/sniffer/browser_type.html ) > > that excludes any browser that isn't explicitly known. > > That's not quite true - Mozilla is recognised as is_nav6up and is_gecko. But a future fully DOM-compliant version of Opera, iCab, OmniWeb or some unforeseen browser will get blocked (unless they spoof as Mozilla) if you only let is_gecko run DOM code. if(is_gecko) { /* some DOM-compliant code here */ } isn't much better than if(is_gecko) { /* some Mozilla-specific code here */ } Also, continuing the use of document.all with Windows IE 6 and Mac IE 5 (through eg. is_ie4up) doesn't quite motivate Microsoft to enhance their standards-support. And what if MS drops document.all support? (Dropping document.all support is not very likely, but Netscape dropped document.layers support, so you never know.) "Do unto others..." and so on. Checking for the existence of the DOM objects and methods (as opposed to checking for the browser identity) promotes interoperability. P.S. The attitude that Mozilla either doesn't exist or that Netscape 6.x supports the same document objects as Netscape 4.x has caused problems. Yet, even the Ultimate Client Sniffer page on www.mozilla.org encourages the use of is_nav4up! -- Henri Sivonen [EMAIL PROTECTED] http://www.clinet.fi/~henris/
