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

Determine if page is in a child window

Status
Not open for further replies.
Jun 19, 2001
86
0
0
US
I need to be able to test if my current page is in a child window. I tried the following but I get Javascript errors if the page isn't in a child. The code works if it is in a child.

if (opener.document) {
opener.location.reload(true);
self.close();
}

Thanks,
Nathan
 
if(window.opener){
theURL = window.opener.location.href
window.opener.location = theURL
self.close()
}

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top