OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <script> |
| 5 if (window.testRunner) |
| 6 testRunner.dumpAsText(); |
| 7 |
| 8 function windowHandler() { |
| 9 var result = document.getElementById('result'); |
| 10 result.innerHTML='FAIL: window.onload event handler did run.'; |
| 11 } |
| 12 |
| 13 function bodyHandler() { |
| 14 var result = document.getElementById('result'); |
| 15 if (result.textContent.startsWith('PASS:')) |
| 16 result.textContent += ", but the document body onload did."; |
| 17 } |
| 18 |
| 19 window.onload = windowHandler; |
| 20 </script> |
| 21 </head> |
| 22 <body onload="bodyHandler()"> |
| 23 This tests that a <body> onload handler clears and replaces the attribute listen
er on the window. |
| 24 You should see "PASS" below. |
| 25 |
| 26 <div id='result'>PASS: window.onload event handler did not run<div> |
| 27 </body> |
| 28 </html> |
OLD | NEW |