1 2 3 4 5 6 7 8 9 10
<html> <script> window.onbeforeunload = function(event) { event.returnValue = "Test beforeunload handler"; }; </script> <body> Test page </body> </html>