pageWithOnBeforeUnloadMessage.html 700 B

1234567891011121314151617181920
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <!--
  5. This page differs from pageWithOnUnload.html in that it returns a string in the
  6. event handler, which causes a different type of alert to appear (the "Stay on
  7. page/Leave current page" alert).
  8. -->
  9. <script type="text/javascript">
  10. function onBeforeUnloadHandler() {
  11. return "This is for WebDriver with onbeforeunload event handler.";
  12. }
  13. window.onbeforeunload = onBeforeUnloadHandler;
  14. </script>
  15. <title>Page with OnBeforeUnload handler</title>
  16. </head>
  17. <body>
  18. <p>Page with onbeforeunload event handler. <a id="navigate" href="alerts.html">Click here to navigate to another page.</a></p>
  19. </body>
  20. </html>