I think the problem is somewhere else in your script. The script you posted
works perfect in Netscape 4.08 on windows 2000 platform.
/Peter
----- Original Message -----
From: "David Spector" <dsqq@y...>
To: "JavaScript HowTo" <javascript_howto@p...>
Sent: Tuesday, December 18, 2001 11:40 PM
Subject: [javascript_howto] Writing text into DIV or LAYER element, IE/NN
> I have the Wrox book by Paul Wilton. On page 493 he describes how to write
> text into a DIV with an implied LAYER. His method works fine for IE, but
> fails for NN4.08. I have tried all sorts of things with no luck. Here is
> one example fragment (this uses LAYER, but DIV fails to work also):
>
> <BODY bgcolor=#ffffff>
> <LAYER ID="layer1">Layer text</LAYER>
> <SCRIPT language=JavaScript><!--
> ...
> else if (IsNN4)
> {
> // This works:
> document.layer1.bgColor = 0xff0000;
>
> // This does nothing:
> document.layer1.document.open();
> document.layer1.document.write('Hi');
> document.layer1.document.close();
> }
> ...
>
> I'll bet the answer is real simple. Paul should have put it in his book.
>
> By the way, the reason I am writing text into an element is that I want to
> create menu buttons out of rectangles with background color and text
> displayed over the background. Then I can create my menus without having
> to generate GIF or JPG files by hand.
>
> David
>
$subst('Email.Unsub').