- Subscribe to the Body.onload using function init()
<body onload="init();" >
sample page
</body> - Subscribe to the onunload event of window object
function init ( url )
{
alert("load");
window.onunload=unloadwindow;
} - Do the oprations in the event handler
function unloadwindow(e)
{
alert("unloaded window / closed");
//Perform your operations here
}
No comments:
Post a Comment
Thanks for commenting in this post to extend the knowledge.It would be great if you comment related to the topics. Please avoid advertisement through comment.