Which is more widely supported: window.onload
or document.onload
?
In Chrome, window.onload is different from , whereas they are the same in both Firefox(version 35.0) and IE (version 11).
You could explore that by the following snippet:
Page contents go here.
And you will see both "window loaded"(which comes firstly) and "body onload" in Chrome console. However, you will see just "body onload" in Firefox and IE. If you run "window.onload.toString()
" in the consoles of IE & FF, you will see:
"function onload(event) { bodyOnloadHandler() }"
which means that the assignment "window.onload = function(e)..." is overwritten.