window.addEventListener ? window.addEventListener('load',myFunction) : window.attachEvent && window.attachEvent('onload',myFunction);