J'ai une fonction qui fait une certaine tâche.à l'intérieur de la fonction j'ai un appel ajax. Si la réponse obtenue à partir d'ajaxcall est vraie, la fonction devrait continuer avec le reste de la tâche. Sinon, elle devrait s'arrêter à ce point. Mais la chose ci-dessus ne se produit pas à la place, la fonction est exécutée indépendamment de l'appel ajax. s'il vous plaît aidez-moi dans ceappel ajax à l'intérieur d'une fonction
function f1(id)
{
var test= id
var url="[email protected]"=+id;
var ajax=new Ajaxrequest(url,validatecallback);
ajax.doGet();
if(id==true){
return;
}
........(some code which has to carried out after the ajax call)
}
function validatecallback
{
this function gets the response for the above mentioned ajaxcall
we are setting a global variable(i.e id) here so that we can use that we can retrieve that in function f1
}
double possible de [? Comment retourner la réponse d'un appel Ajax] (http://stackoverflow.com/questions/14220321/how-to-return-the- réponse-d'-un-ajax-appel) – Bergi