Groups | Blog | Home
all groups > dotnet jscript > october 2003 >

dotnet jscript : Detecting a Browser Close



Nithi Gurusamy
10/21/2003 11:01:33 AM
Dear Group:

I unknow we can use onunload events of window and body objects to detect
when the URL changes. But is there a event that tells me the Internet
Explorer or Netscape window itself is closing?

Thanks
Nithi Gurusamy

Nithi Gurusamy
10/21/2003 3:08:00 PM
Hi Raffaele:

My requirement is like this. I open a popup window from a parent window when
the user clicks on a link. From the popup window user can click links that
will target the parent window causing the URL change in parent window. This
is what I want. Now the problem is when the user closes the browser, the
popup window must be closed automatically. Also the popup window must be
closed whenever the URL in the parent window changes to any other domain
other than my current domain. For example, if my current domain is
www.mysite.com, how will I detect the URL change so that I can close the
popup window right away. Also I need to close the popup window on browser
close.

Thanks
Nithi Gurusamy


[quoted text, click to view]

Raffaele Rialdi [MVP]
10/21/2003 9:29:06 PM
Look at my answer to your post in the previous thread.

--
Raffaele Rialdi
Microsoft .NET MVP http://mvp.support.microsoft.com
UGIdotNET - User Group Italiano .NET http://www.ugidotnet.org



[quoted text, click to view]

Raffaele Rialdi [MVP]
10/22/2003 12:38:09 PM
Try the sample I posted and I think you can easily detect the browser quit.

Since we have available only the unload event and there is not a specific
quit event, you shoud handle all the other events that cause the document to
be unloaded.
In my sample I have handled links (A tags) that cause the page to be
unloaded. If you have other events, you have to handle it specifically.

--
Raffaele Rialdi
Microsoft .NET MVP http://mvp.support.microsoft.com
UGIdotNET - User Group Italiano .NET http://www.ugidotnet.org



[quoted text, click to view]

AddThis Social Bookmark Button