Home | History | Annotate | Download | only in beforeload
      1 <?xml version="1.0" encoding="UTF-8"?>
      2 <html xmlns="http://www.w3.org/1999/xhtml">
      3 <head>
      4 <script src="resources/print.js"></script>
      5 </head>
      6 
      7 <body>
      8 <p>This page tests the beforeload event on script elements.  You should see a PASS message below if everything
      9 works.</p>
     10 <hr/>
     11 <div id="console"></div>
     12 
     13 <script>
     14 if (window.layoutTestController)
     15     layoutTestController.dumpAsText();
     16     
     17 function beforeLoadFunc()
     18 {
     19     print("PASS", "green");
     20     event.preventDefault();
     21 }
     22 
     23 document.body.addEventListener("beforeload", beforeLoadFunc, true);
     24 </script>
     25 <script src="resources/fail.js"></script>
     26 
     27 </body>
     28 </html>
     29