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

How to trap the Browser Window Close Event

Status
Not open for further replies.
Aug 16, 2001
26
0
0
NZ
Hi !

I want to trap the event, when my browser window is getting closed (via the top right X). Based on this I'm doing a certain tasks.

regards,
rpathy.
 
I think you can trap the event when the page unloads by saying <body onunload=&quot;... but not sure about just the browser through the x button
 
also should be able to do it via:

function doStuff() {
// stuff here...
}

<body onbeforeunload=&quot;doStuff();&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top