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

How to detect parent window URL from child (pop-up) window

Status
Not open for further replies.

haroonqurehi

Programmer
Jul 22, 2004
5
US
I want to pop up window when user leaves the DOMAIN (either close the browser window or go to another site). I am opening it on onUnload event of body but it is fired on every new request even within the domain (like from one page of site to another). I only want it when leaving the site.

I am trying to detect in child window about the new URL of parent window and see if this is same domain then close the child window but can't check the new URL of the window.

Anyone has got any experience or idea ?
 
the only way i can think of is to disable the onunload event when a link is clicked:
<body..... onunload="OpenPop">

<a href="DomainFile.html" onclick="document.body.onunload=''">Link</a>

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top