David
0
Q:

window.onload execute after load page

//put your JS code in
document.onload = function {
	// the code here will run when all the HTML is loaded (but the css and the images may miss)
}

// or in
window.onload = function {
  // the code here will run when the whole page is loaded (including css and images)
}
1
/* javascript function is executed after 5 seconds page was loaded */
window.onload = function() {
   setTimeout(loadAfterTime, 5000)
}; 
 
function loadAfterTime(){
   document.getElementById("menu").style.display="block";
}
0
<body onload="script();">
<!-- will call the function script when the body is load -->
1

New to Communities?

Join the community