javascript on loaded code example
Example 1: window.onload
window.onload = function() {
// Some code
};
Example 2: how to call a function as soon as a page loads javascript
<body onload="yourFunction()"> </body>
Example 3: javascript execute code on page load
<html>
<body onload="loaded();"></body>
<script>
function loaded() {
alert('Page is loaded');
}
</script>
</html>