Summary:
Following body onload works when a link to another script using <script>
is included in the head tag but not while the same <script>
is included just before the end of body
<body onload="console.log('body loaded');">
To Reproduce:
Load Complete code in Fiddle
When we set the Javascript Loadtype to No Wrap - In <head>
, we see the following logs in the console:
DOM Loaded
window loaded
body loaded
But when we set it to No Wrap - In <body>
, we see the following logs in the console:
DOM Loaded
window loaded
Why the difference?