View Full Version : event in javascript when window closed.

03-15-2009, 09:31 PM
hey!!!!!!!!! does any one know which event is called when a browser window is closed by a user.

please help me out.

03-15-2009, 10:18 PM
That would be ONUNLOAD.

03-16-2009, 08:50 AM
ya onunload or onbeforeunload

onbeforeunload is more useful because you have the DOM to work with - there's not much you can do on the actual page itself with onunload except send off a quick ajax request to record whatever u need. keep in mind though that opera (i believe even the latest version) doesnt support onbeforeunload

03-16-2009, 09:06 AM
thanks to all