87
rated 0 times
[
93]
[
6]
/ answers: 1 / hits: 70109
/ 12 Years ago, tue, october 23, 2012, 12:00:00
function test(){
var distance=null;
first();
second();
third();
alert(distance);//it shows null always because it take 2 second to complete.
}
function first(tolat, tolon, fromlat,fromlon){
// calulating road distance between two points on the map using any other distance caluculating apis.
distance=dis; // update the value of distance but it takes 2 second to complete.
}
function second(){}
function third(){}
i have this type of situation in my code, now many time function three is called before first and second complete execution and distance value is not updated.
More From » jquery