how to run a function when a page loads javascript code example
Example: execute javascript function when page loads
window.onload = function() {
yourFunction(param1, param2);
};
window.onload = function() {
yourFunction(param1, param2);
};