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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing layer in NN

Status
Not open for further replies.

Grom

Programmer
Feb 8, 2001
7
GB
I'm trying to check if a layer exists in a script and NN keeps telling me the layer doesn't when I know it does.

I've got two <layers> in the page and a script that's called in one of the layers has to check that the other named layer is there.

In essence....
Code:
<layer id=&quot;layer1&quot;......>
<script>
if (document.layer2){
    doSomeStuff
}
</script>

Other stuff

</layer>

<layer id=&quot;layer2&quot;......>

whatever

</layer>

The second layer gets dynamically created on the server which is why I need to check for it.
Even in NN debug tool it tells me that the document.layers array exists but the zeroth element is empty.

Any ideas?

(To be honest the page is a little more complex but....)
 
Nah, tried that already.

I keep getting a &quot;document.layer1 has no properties&quot; error.
 
have it print a client-side variable, soemthing like:

<script>
Global_madelayer = <%if(prtlyr){Response.write(&quot;true&quot;)}else{Response.write(&quot;false&quot;)}%>
</script>

Above is ASP code, but ti should be basically the same in most languages... then test against that variable jared@aauser.com -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top