Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape: writing layers in document with writeln() function

Status
Not open for further replies.

fernanss

Programmer
Oct 25, 2001
5
ES
if I write within javascript tags, for a Netscape browser:

Code:
document.writeln(&quot;<layer id='menu1' style='position:relative'>&quot;);
document.writeln(&quot;<IMG id='imCat1' src='closed.gif' border='0'>Categoría 1&quot;);

the browser writes into the shown html page (it duplicates the string):

Code:
<LAYER id='menu1' style='position:relative'><LAYER id='menu1' Ttyle='position:relative'>
<IMG id='imCat1' src='closed.gif' border='0'>Categoría 1

Another problem is that if I try to write javascript code like this:

Code:
  document.writeln(&quot;<&quot;+&quot;SCRIPT LANGUAGE='JavaScript'&quot;+&quot;>&quot;);
  document.writeln(&quot;<!--&quot;);
  document.writeln(&quot;function getRef(id)&quot;);
  document.writeln(&quot;{&quot;);

  document.writeln(&quot;   return document.layers[id];&quot;);

  document.writeln(&quot;}&quot;);

  document.writeln(&quot;//  End -->&quot;);
  document.writeln(&quot;</&quot;+&quot;SCRIPT&quot;+&quot;>&quot;);

Netscape browser doesn't write it into the document, whereas Explorer does.

Any idea?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top