Solved

Call a javascript function on page load

Posted on 2011-09-05
2
296 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
how to create a tile layout 1 20
responsive divs setup - what am I doing wrong 2 33
Datepicker in PHP 9 21
WIX Redirect 1 1
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to dynamically set the form action using jQuery.

747 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now