body onunload
-
I have been trying to get the method to work. I have seen and tried quite a few online examples including the example found on W3C (which is below). Even on their site, it doesn't work. I have tried to get the method to work by: Refresh the page, using back and forward buttons, and closing the window. Nothing happens in IE, Firefox or Chrome. I am at a loss as to why this doesn't work.
<html>
<head>
<script>
function myFunction()
{
alert("Thank you for visiting W3Schools!");
}
</script>
</head><body onunload="myFunction()">
Welcome to my Home Page
Close this window or press F5 to reload the page.
</body>
</html> -
I have been trying to get the method to work. I have seen and tried quite a few online examples including the example found on W3C (which is below). Even on their site, it doesn't work. I have tried to get the method to work by: Refresh the page, using back and forward buttons, and closing the window. Nothing happens in IE, Firefox or Chrome. I am at a loss as to why this doesn't work.
<html>
<head>
<script>
function myFunction()
{
alert("Thank you for visiting W3Schools!");
}
</script>
</head><body onunload="myFunction()">
Welcome to my Home Page
Close this window or press F5 to reload the page.
</body>
</html> -
I have been trying to get the method to work. I have seen and tried quite a few online examples including the example found on W3C (which is below). Even on their site, it doesn't work. I have tried to get the method to work by: Refresh the page, using back and forward buttons, and closing the window. Nothing happens in IE, Firefox or Chrome. I am at a loss as to why this doesn't work.
<html>
<head>
<script>
function myFunction()
{
alert("Thank you for visiting W3Schools!");
}
</script>
</head><body onunload="myFunction()">
Welcome to my Home Page
Close this window or press F5 to reload the page.
</body>
</html>BODY object in Internet Explorer, see http://msdn.microsoft.com/en-us/library/ms535205(v=vs.85).aspx