[Javascript] Named Layers in IE

Peter Brunone peter at brunone.com
Mon Aug 27 10:39:17 CDT 2001


    You mean by cycling through document.all?  Why don't you just check for
a value of .name, and if none exists, you disregard it?  Seems like the DOM
is being even more helpful than you need.

----- Original Message -----
From: "Jay Lepore" <admin at myinternethandyman.com>
To: <javascript at LaTech.edu>
Sent: Monday, August 27, 2001 4:32 AM
Subject: [Javascript] Named Layers in IE


| Hello,
|
| If I want to display a list of just the named layers in Netscape, I
| could use this code:
|
| var layersln;
| var layernm="";
| layerslen=window.document.layers.length;
| for(index=0;index<layerslen;index++) {
| var layernm=layernm+"layer "+index+" =
| "+window.document.layers[index].name+"\n";
| }
| alert(layernm);
|
| In IE however, I cannot figure out how to accomplish the same thing
| without getting ALL layers instead of just named layers.
|
| Any ideas?




More information about the Javascript mailing list