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

Netscape Issue with JS function

Status
Not open for further replies.

Linnq

Programmer
Oct 24, 2003
13
CA
I have a script which detects whether or not the page was loaded from within a particular frameset, if so, the home button is not visible.
If not then the home button is visible, works fine in IE but not in NS 7.1 or MoZilla 1.6

I have given the home button on the pages both a name and an id of "homeButton"

Any help is appreciated (function below)

//Determines whether page was opened from within the site or from an external source.
//If internal the link to the home page is not visible.
//If external the link to the home page is visible.
<!---
function Opener()
{
if (window.opener != null) // If there is an opener object
{
if (window.opener && window.opener.top.document.title!="Name Of Frameset") // If the opener object's title is not "Name Of Frameset"
{
document.all.item("homeButton").style.visibility="visible"; // Show link to home page
}
else
{
document.all.item("homeButton").style.visibility="hidden"; // Don't show link to home page
}
}
else // If there is NOT an opener object
{
document.all.item("homeButton").style.visibility="visible"; // Show link to home page
}
}
//-->

Linq
 
Instead of document.all.item, use document.getElementById() for both IE and NS. Make sure you have a matching id attribute.

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top