Layer Element

Layers were the core of a method of dynamic HTML programming specific to Netscape 4. Each layer was treated as a separate document object in JavaScript. The content could be included in the same file within the non-standard layer element (or any other element with the positioning set to "absolute" via CSS) or loaded from a separate file with or

. It could also be generated via JavaScript with the layer = new Layer constructor. The content would then be inserted into the layer with layer.document.write.

But in modern browsers, the functionality of layers is provided by using an absolutely-positioned div, or, for loading the content from an external file, an IFrame.

Irrelevant to the actual use of layers, when Netscape 4 and Internet Explorer had significantly different JavaScript implementations, a JavaScript program would very often need to run different blocks of code, depending on the browser. To decide which bunches of code to run, a JavaScript program would test for support for layers, regardless of whether the program involved layers at all. Namely,

if( document.layers ) { ...code that would be executed only by Netscape browsers... } else { ...code that would be executed only by Internet Explorer... }

Famous quotes containing the words layer and/or element:

    A revolution is not the overturning of a cart, a reshuffling in the cards of state. It is a process, a swelling, a new growth in the race. If it is real, not simply a trauma, it is another ring in the tree of history, layer upon layer of invisible tissue composing the evidence of a circle.
    Kate Millett (b. 1934)

    To get a man soundly saved it is not enough to put on him a pair of new breeches, to give him regular work, or even to give him a University education. These things are all outside a man, and if the inside remains unchanged you have wasted your labour. You must in some way or other graft upon the man’s nature a new nature, which has in it the element of the Divine.
    William Booth (1829–1912)