Skip to content

Instantly share code, notes, and snippets.

@systemhalted
Created June 26, 2012 09:50
Show Gist options
  • Save systemhalted/2994747 to your computer and use it in GitHub Desktop.
Save systemhalted/2994747 to your computer and use it in GitHub Desktop.
Code Snippet for performing certain tasks on browser close event
<head>
<Title>fnPerformTasksOnUnload</Title>
<script>
function fnPerformTasksOnUnload(){
alert("Thanks for visiting us! Visit us again soon!");
}
</script>
</head>
<body onUnload="fnPerformTasksOnUnload()">
Code Snippet for performing certain tasks on browser close event.
Just close the browser and check for yourself.
I have tested this on IE and Firefox and it works fine.
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment