Call a javascript function on page load

dshrenik
dshrenik used Ask the Experts™
on
Please let me know how I can call a javascript function automatically when the page loads.
Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
<body onload="ex()">

or

window.onload=ex();
or also

window.onload = function(){
  //invoke code here
  alert("page loaded");
};

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial