hey guys,
so i am messing around with some simple JS, and i was using the onLoad & onUnload handlers.
i can easily get the onLoad=(function) to work properly, yet when it comes to getting the onUnload to work when i close the window or refresh the site, noting seems to work
<script>
function alert1(){
alert("Welcome to the page, enjoy");
}
function aler02(){
alert("Thanks for visiting, goodbye");
}
</script>
<body onLoad="alert01();" onUnload="alert02();">
<p> This is text </p>
</body>
again when i open the site, it works just fine and as expected. when i close or refresh i expect an alert to let me know i am leaving, yet nothing.
any suggestions ?