Make script work on a specific page

wxdqz

New Member
In my javascript I am using this to hide a form object in my page using Netscape 4. It works great on that page but creates problems on other pages which use the javascipt. Anyway to make this condition work on just the one page (called mypage.html)?

How I create layer in mypage.html

<ilayer id="l1">
<form action="form.html">
<input type="text">
</form>
</ilayer>

Here is how I am using it located in a seperate javascript file, which works great on mypage.html

if(document.layers)
{
document.l1.visibility = "hide";
}

Now I need to make it where it only effects "mypage.html" so other pages that are using the javascript will not get this part of the javascript.
I tried this but not working:

if(document.layers) == 'mypage.html'
{
document.l1.visibility = "hide";
}
 
Back
Top