This is great, thnx a lot
This resolves half of the problem.
If I close the browser without doing anything and write alert(targ) in onUnload event, this doesn't work.
Actually I am trying to catch the event(target URL), if user goes to any other page OR if user closes the browser.
Is it possible in onUnload event to catch which link is clicked that invokes new page(new URL request to browser, either through address bar or any link through web site or form post )
like if I am www.abc.com/first.html and second.html link is clicked, is it possible to catch this second.html...
I want to pop-up window when user leaves site (either by closing browser window or going to any other site). I dono want a popup as long as user browses within the domain.
Please share your ideas.
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.