I am executing a function and i want to pause execution for some time.
function a(){
}
//here some code --- I am using result of a function here...
Can anyone help me... how to use asynchronous call??
I am executing a function and i want to pause execution for some time.
function a(){
}
//here some code --- I am using result of a function here...
Can anyone help me... how to use asynchronous call??
Not sure what you mean - to use result of a function, assign it to a variable:
var r = a();
//....some code...
//using result of a function here
alert("result of a(): " + r);
In case of AJAX or something similar use the callback function provided to you, for example with jQuery:
$.post("myajaxpage", function() {
//callback function - executed after request is finished
var r = a();
alert("result of a(): " + r);
});