on page load in javascript code example
Example 1: js on page loaded
window.onload = function() {
yourFunction(param1, param2);
};
Example 2: how to call a function as soon as a page loads javascript
<body onload="yourFunction()"> </body>
Example 3: javascript onload
<body onload="myFunction()">