use window.onload.