window.addEventListener instead of window.onload