js vanila when page is loaded code example Example: js on page loaded window.onload = function() { yourFunction(param1, param2); };