Today use this Code but this code some time not properly work
Problem : Page refresh then call unload()
but some time user change URL directly at that time not call unload()
because website change...
So, How to solve it in all Browser. Please Help Me
<html>
<head>
<script type="text/JavaScript">
function unload(){
alert("My Page unLoad - Destroy Variable");
}
function load() {
alert("My Page Load");
}
</script>
</head>
<body onLoad="load()">
<script type="text/javascript">
window.onbeforeunload = unload();
</script>
</body>
</html>