In article <[EMAIL PROTECTED]>, Marshall 
<[EMAIL PROTECTED]> wrote:

> I see one other problem with this snippit of code.  What happens when
> Microsoft releases a version of their browser with an appVersion of 5? 

Not only that, the code doesn't take into account the possibility that 
there might be other standards-compliant browser with ECMAScript and DOM 
support in addition to those that identify themselves as "Netscape".

if (document.getElementById){
  /* Any browser that implements getElementById() and maybe other basic
     DOM1 features, including Mozilla, Mozilla-based browsers, IE 5.x
     for Windows, IE 5 for Mac, Opera... */
}

if (document.layers) {
  /* Nav 4.x */
} else if (document.all) {
  /* IE 4 and up */
} else if (document.getElementById){
  /* Browser that implement getElementById() and maybe other basic
     DOM1 features but don't implement document.all, including Mozilla,
     Mozilla-based browsers, Opera...*/
}

if (document.layers) {
  /* Nav 4.x */
} else if (document.getElementById){
  /* Any browser that implements getElementById() and maybe other basic
     DOM1 features, including Mozilla, Mozilla-based browsers, IE 5.x
     for Windows, IE 5 for Mac, Opera...*/
} else if (document.all) {
  /* IE 4 */
}

-- 
Henri Sivonen
[EMAIL PROTECTED]
http://www.clinet.fi/~henris/

Reply via email to