The onload event
The onload event is a condition that occurs when an object has been loaded. The onload event mostly comes and used with an element of “body” to execute a script once after a web page has completely loaded the entire of contents ( these include the CSS files, script files, images, text, etc). The onload event can use to check the browser type and version from the web visitor which will lead the proper web page to depend on the information that has been recognized. The onload event is sometimes able to used together with cookies.
The onload event browser support
The onload event is available for several search engines to include google chrome, internet explorer, firefox, opera mini, and safari.
The confirm box
The prompt box
That prompt box is the type of popup box that is used when you want your user for input the value before you enter the page. When the prompt box is popup then the user will have to click “OK” or to click “Cancel” to proceeding to next after entering the value. The syntax from the prompt box is a window.prompt(“sometext”).
Differences between document load and body onload
The onload event is the standard event in the DOM, on another side; the ready event is the specific JQuery. The key differences between the document.ready with window load event that the code that included inside of onload function will run once to the entire pages(this includes iframes, images, stylesheets, etc) and loaded is whereas the document ready event fires before the entire images, iframes, and others are loaded but after the entire DOM is ready.