I was on jsfiddle.net recently and I saw this as a configuration option. This got me to thinking that it might help a problem I’m having as such:
I load multiple images (haven’t upgraded to a single sprite yet) so that I can not use my controls until they are all downloaded…the images take most of the download time so that for the first few seconds I can not access my controls.
Currently I’m using one of these two..both work.
window.onload = initialize_page
window.addEventListener('load',initialize_page);
Related
Jquery document ready vs. window.onload
AFAIK
onDomReady()fires once the DOM has loaded. If the page contains external sources, such as images, then it may fire before these have finished loading.onLoad()fires after the whole page has finished loading, including external sources.So it’s possible for
onDomReady()to fire beforeonLoad()but you’ll have to test it on your page.