Re: navigation bars-absent on newer version of Netscape

by "tim booker" <timbooker(at)btinternet.com>

 Date:  Mon, 23 Apr 2001 15:31:54 +0100
 To:  <hwg-techniques(at)hwg.org>,
"Tamara" <Tamara(at)abbeyink.com>
 References:  abbeyink
  todo: View Thread, Original
Hello Tamara,

In fact you don't need to write things different ways for Netscape 6 and
IE5, because they both support the standard DOM.  The problem is supporting
IE4 and Netscape 4, which both ignored the standard and created their own
version of the DOM.

Let's say for example, that you wanted to refer to the top position of a div
called "menuDiv".

The standard way to refer to this would be:

document.getElementById('menuDiv').style.top

This is supported by Netscape 6, IE5, Opera 5, etc...

However, in IE4 you would refer to this with:

document.all.menuDiv.style.top

and in Netscape 4 you would refer to it as:

document.menuDiv.top

(You should note that your old "document.all" scripts work in IE5 because it
supports both the standard DOM and the old IE4 DOM!)

So you DO need 3 versions of the script.  One uses the standard DOM, and the
other two are for the version 4 browsers only.

You should be using the "getElementById" method in your scripts, because IE5
supports it, and Netscape 6, Opera and Konquerer all require it.

In other words, IE5, Opera and Netscape 6 HAVE all adopted the W3C standard.

Hmmmm... Hope that wansn't too confusing!

Tim



www.timbooker.com



----- Original Message -----
From: "Tamara" <Tamara(at)abbeyink.com>
To: <hwg-techniques(at)hwg.org>
Sent: Monday, April 23, 2001 1:22 PM
Subject: Re: navigation bars-absent on newer version of Netscape


At 07:41 AM 4/23/2001 +0000, Peter-Paul Koch wrote:
>(Note that Explorer 5 *also* supports the old proprietary document.all
DOM).
>
>If you only want to do DHTML the new DOM is fairly simple. Where for
Explorer you would say
>
>document.all['thelayer'].style.visibility = 'visible';
>
>for Netscape 6 you say
>
>document.getElementById('thelayer').style.visibility = 'visible';

Tim,

This is where I got the idea that NS does its own thing -- if there is /one/
DOM for all as you said, then why do we still have to write it one way for
NS6 and one way for IE5?

I admit, I don't understand it and I've been to PPK's site many, many times
in an attempt to understand this. IF NS 6 is supporting the W3C DOM, then
why are we still writing it twice (3 times if you include NN)?

In my mind where logic does occasionally leave me high and dry, if there is
one W3C DOM, then IE5 (or 5.5) Opera, NS 6, et al, should pick one and stick
with it.

So by saying they *do their own thing* -- that's my non-tech speak for
having yet a new level of code for those nifty menus that some folks just
/have/ to have. I apologize for mis-representing, but even after you and PPK
tried to explain it to me again, it still looks like one of them is doing
something to make my life difficult.

Tamara

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA