...

View Full Version : Open Pop-Up On Browser Close?



jayminkey
07-17-2009, 08:08 AM
Hi,

I have used below javascript function in body tag unload event...

<body onunload="openpopup();">
</body>

function openpopup()
{
Window.open('popupwin.asp','popUp','scrollbars=no,resizable=no,height=300,width=300');
}

Problem :
When i am refreshing the page Or click any link on page this pop up open....i want to open pop-up only when some one close the page..


How can i detect browser close event?
I am using classic ASP...
can any one help me in this?

thanks,
jaymin

Philip M
07-17-2009, 08:45 AM
It is not possible using Javascript to detect a browser close event as compared with a page change or refresh. In any case, what about people with Javascript disabled?




Quizmaster: Which African country gives its name to the complaint known as 'gippy tummy'?
Contestant: Venezuela.

Amphiluke
07-17-2009, 08:53 AM
The window object has an onclose (https://developer.mozilla.org/en/DOM/window.onclose) event, but it seems to be not supported by any browser until now.

Philip M
07-17-2009, 09:12 AM
The window object has an onclose (https://developer.mozilla.org/en/DOM/window.onclose) event, but it seems to be not supported by any browser until now.

Well ,that makes it particularly useful! :rolleyes:

Amphiluke
07-17-2009, 09:32 AM
Such a reference (http://msdn.microsoft.com/en-us/library/ms536907(VS.85).aspx) must be of interest to the author of the topic. (See example at the bottom of that page.)

Philip M
07-17-2009, 10:05 AM
To be pedantic, onclose is not an event, it is an event handler. The respective event would be named close. However, there is no such event in W3C DOM Level 2 Events (or the Working Group Note on DOM Level 3 Events),

A1ien51
07-17-2009, 08:20 PM
Sad thing is pop up blockers will block it so no one will see it anyway. We are not living in 1999 anymore. :)

Eric

jayminkey
07-22-2009, 05:49 AM
Thank you all for help.
i am working on this....



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum