{"id":424,"date":"2009-11-12T11:29:53","date_gmt":"2009-11-12T15:29:53","guid":{"rendered":"https:\/\/htmlcssjs.wpengine.com\/?p=424"},"modified":"2014-10-08T16:40:46","modified_gmt":"2014-10-08T20:40:46","slug":"netscapes-javascript-documentation-from-1999-document-layers","status":"publish","type":"post","link":"https:\/\/htmlcssjavascript.com\/javascript\/netscapes-javascript-documentation-from-1999-document-layers\/","title":{"rendered":"Netscape&#8217;s Javascript Documentation From 1999 (document.layers!)"},"content":{"rendered":"<p>Don&#8217;t ask why I&#8217;m poking around the wayback machine (that would spoil the surprise,) but if you&#8217;ve been around as long as I have and want to reminisce, or never got to experience Web 1.0 as a developer and want to see what all the complaints are about, you should really take a look at <a href=\"http:\/\/web.archive.org\/web\/19991012215641\/developer.netscape.com\/docs\/manuals\/js\/client\/jsref\/index.htm\">Netscape&#8217;s JavaScript documentation from 1999<\/a>.<\/p>\n<p>Here&#8217;s one that will confuse the hell out of anyone who started doing this after maybe 2003:<br \/>\n<!--more--><\/p>\n<blockquote><p>\n<strong>document.layers<\/strong><br \/>\nThe layers property is an array containing an entry for each layer within the document.<br \/>\n<strong><br \/>\nProperty of<\/strong><\/p>\n<p>document<\/p>\n<p><strong>Implemented in<\/strong><\/p>\n<p>JavaScript 1.2<br \/>\n<strong><br \/>\nDescription<\/strong><br \/>\nYou can refer to the layers in your code by using the layers array. This array contains an entry for each Layer object (LAYER or ILAYER tag) in a document; these entries are in source order. For example, if a document contains three layers whose NAME attributes are layer1, layer2, and layer3, you can refer to the objects in the layers array either as:<\/p>\n<p><code>document.layers[\"layer1\"]<br \/>\ndocument.layers[\"layer2\"]<br \/>\ndocument.layers[\"layer3\"]<\/code><\/p>\n<p>or as:<\/p>\n<p><code>document.layers[0]<br \/>\ndocument.layers[1]<br \/>\ndocument.layers[2]<\/code><\/p>\n<p>When accessed by integer index, array elements appear in z-order from back to front, where 0 is the bottommost layer and higher layers are indexed by consecutive integers. The index of a layer is not the same as its zIndex property, as the latter does not necessarily enumerate layers with consecutive integers. Adjacent layers can have the same zIndex property values.<\/p>\n<p>These are valid ways of accessing layer objects:<\/p>\n<p><code>document.layerName<br \/>\ndocument.layers[index]<br \/>\ndocument.layers[\"layerName\"]<br \/>\n\/\/ example of using layers property to access nested layers:<br \/>\ndocument.layers[\"parentlayer\"].layers[\"childlayer\"]<\/code><\/p>\n<p>Elements of a layers array are JavaScript objects that cannot be set by assignment, though their properties can be set. For example, the statement<\/p>\n<p><code>document.layers[0]=\"music\"<\/code><\/p>\n<p>is invalid (and ignored) because it attempts to alter the layers array. However, the properties of the objects in the array readable and some are writable. For example, the statement<\/p>\n<p><code>document.layers[\"suspect1\"].left = 100;<\/code><\/p>\n<p>is valid. This sets the layer&#8217;s horizontal position to 100. The following example sets the background color to blue for the layer bluehouse which is nested in the layer houses.<\/p>\n<p><code>document.layers[\"houses\"].layers[\"bluehouse\"].bgColor=\"blue\";<\/code><\/p>\n<p>To obtain the number of layers in a document, use the length property: document.layers.length.\n<\/p><\/blockquote>\n<p>Have you ever heard someone say the phrase &#8220;<a href=\"http:\/\/www.lissaexplains.com\/html7.shtml\">div layer<\/a>&#8221; and wondered what the heck they were talking about? Now you know. Netscape had a parallel concept to DIVs that they called <a href=\"http:\/\/web.archive.org\/web\/20001213222000\/developer.netscape.com\/docs\/manuals\/htmlguid\/index.htm?content=tags12.htm#tags:LAYER\">LAYERs<\/a> and for a while you had to deal with these two competing technologies in ways that were generally unpleasant (so unpleasant I forget the specifics.)  This two-pronged approach was so ingrained in the way we looked at things we made a hybrid term, &#8220;div layer&#8221; to describe them.<\/p>\n<p>I look back and am amazed at the fact that we got anything at all done back then.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Don&#8217;t ask why I&#8217;m poking around the wayback machine (that would spoil the surprise,) but if you&#8217;ve been around as long as I have and want to reminisce, or never got to experience Web 1.0 as a developer and want to see what all the complaints are about, you should really take a look at [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-424","post","type-post","status-publish","format-standard","hentry","category-javascript"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3uLY6-6Q","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/htmlcssjavascript.com\/wp-json\/wp\/v2\/posts\/424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/htmlcssjavascript.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/htmlcssjavascript.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/htmlcssjavascript.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/htmlcssjavascript.com\/wp-json\/wp\/v2\/comments?post=424"}],"version-history":[{"count":0,"href":"https:\/\/htmlcssjavascript.com\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"wp:attachment":[{"href":"https:\/\/htmlcssjavascript.com\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/htmlcssjavascript.com\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/htmlcssjavascript.com\/wp-json\/wp\/v2\/tags?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}