<!DOCTYPE html> <html> <head> <script type="text/javascript"> "use strict"; function Fired() { alert ('window.onload fired'); } window.onload=Fired; </script> </head> <body> Compare to <a href="onload_in_body_tag.html"><code><body onload="func();"></code></a>. </body> </html>