Javascript That Executes After Page Load

For More Videos Visit Our YouTube Channel




Here we consider how to execute JavaScript After Page Load. If JavaScript is inside head section, it loads before the body part is loaded. Normally JavaScript executes from top to bottom. Sometimes you may execute JS before its requirements are fully loaded. For executing JS after the page is fully loaded we can use following methods.

document.onload = function Name()
{
....Execute JavaScript Code Here.....
}



Else you can use below method.

window.onload = function Name()
{
....Execute JavaScript Code Here.....
}



By this way we can execute Javascript after the page is fully loaded.