GuidesNetscape 6, Part I: Detection and Scripting Page 4

Netscape 6, Part I: Detection and Scripting Page 4

ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.




The line above should be tan in Netscape Navigator. It should have a white background in Internet Explorer because IE silently ignores the LAYER tag. Similarly, Netscape 6 does not support this tag and the line above should have a white background in Netscape 6.

When Netscape 6 silently ignores the LAYER and ILAYER tags, it also ignores their attributes. These attributes include the SRC attribute by which the LAYER element links external files. The behavior of such an element is not intuitive. In Netscape Navigator, the linked in external file determines the content of the LAYER element. Since the SRC attribute is ignored in Netscape 6, the content of the LAYER element is determined by whatever is written in the HTML file between the and the . Let’s take an example. The following HTML should link in a GIF file in Netscape Navigator, and should ignore the current content of the tag:


This LAYER tag links in a small GIF file (the local page mark in the columns' navigation links).

Convince yourself it’s working fine in Netscape Navigator. In Internet Explorer and Netscape 6, The GIF should vanish and the content rendered is the line above, “This LAYER tag links…”:

This LAYER tag links in a small GIF file (the local page mark in the columns’ navigation links).

Similarly to the LAYER tag, Netscape 6 does not support the NOLAYER tag. As discussed above for the LAYER tag, Netscape 6 will ignore any attributes of the LAYER tag, including the SRC attribute, which is used to import external files. Netscape 6 will render, though, any tags placed between the and tags. We now have a simple way to make a page two-way browser-independent between Netscape Navigator and Netscape 6. Place Netscape Navigator-specific content in an external file and reference is by a or . Netscape 6 will ignore it silently. As for Netscape 6’s specific content, enclose it between and . Netscape Navigator will silently ignore these tags and whatever is enclosed between them, while Netscape 6 will silently ignore these tags, but will render everything that is enclosed between them.

Netscape 6 does not support document.layers and other layer DOM features. Do not use the layer DOM in your JavaScript scripts either.

Netscape Navigator supports several properties and methods for setting CSS properties from JavaScript: document.tags, document.ids, document.classes, and document.contextual. Netscape 6 does not support them, so avoid them altogether.

In summary, when starting a new development, avoid the following:

    Get the Free Newsletter!

    Subscribe to Daily Tech Insider for top news, trends & analysis

    Latest Posts

    Related Stories