Solved

Call a javascript function on page load

Posted on 2011-09-05
2
298 Views
Last Modified: 2012-05-12
Please let me know how I can call a javascript function automatically when the page loads.
Thanks!
0
Comment
Question by:dshrenik
2 Comments
 
LVL 20

Accepted Solution

by:
chaitu chaitu earned 250 total points
ID: 36486618
<body onload="ex()">

or

window.onload=ex();
0
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 250 total points
ID: 36486636
or also

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

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question