Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
i have 2 functions like
function function1()
{

alert(' a');
//code
function2()

}function function2()
{
//code

}
Posted

1 solution

Can you please explain a bit what actually you want to achieve here ?

Because as i know all functions if is written one after another will be executed in same order. As by default in JavaScript they will be called synchronously only. So rather than calling the second method within the first method at end you can call the second method after first method only.

JavaScript
function1();
function2();


Calling them in order will execute the first method first and then the second method will be called.

Hope this will be of help to you :-

http://stackoverflow.com/questions/5187968/how-should-i-call-3-functions-in-order-to-execute-them-one-after-the-other
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900