How to call function page load in Javascript?
If you want the onload method to take parameters, you can do something similar to this: window. onload = function() { yourFunction(param1, param2); }; This binds onload to an anonymous function, that when invoked, will run your desired function, with whatever parameters you give it.execute javascript function when page loads
window.onload = function() {
yourFunction(param1, param2);
};