[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

Call a javascript function on page load

Please let me know how I can call a javascript function automatically when the page loads.
Thanks!
0
dshrenik
Asked:
dshrenik
2 Solutions
 
chaitu chaituCommented:
<body onload="ex()">

or

window.onload=ex();
0
 
Gurvinder Pal SinghCommented:
or also

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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now