how to call two javascript function onload event

When you working with the php and javascript then you get below question in mind when you stuck.

How to call two function onload event?
how to call more then one function when page load?
how to call two javascript function when page load?

Some time we need to call more then one javascript function when the page load, most of programmer make mistake and they call one function using onload body tag and another one using window.load = function name. when you do like this then its call only one function and another one will not call.

to get proper result we need to use any one method from below three methods.

 
1) <body onload="phpfreelancer();hirephpprogrammer();phpfreelancerindia();">

Here, you can call all function using the onload event of body tag.

 
2) function loadonstart()
{
phpfreelancer();
hirephpprogrammer();
phpfreelancerindia();
}
 
window.onload = loadonstart();

Here, you call one function on window load event and in that function you can call other function.

 
3)   window.onload = phpfreelancer();
window.onload = hirephpprogrammer();
window.onload = phpfreelancerindia();

Here, you call all three function using separate code.

I Hope this will resolve you problem if not then you can contact me any time.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>