I have a search problem when all ajax are complete. Here is my function.
function getValuesForTablePropertySelected(questionList, itemsArray) {
for (var i = 0; i < itemsArray.length; i++) {
switch (itemsArray[i]) {
case "Tags":
loadTag(questionList);
break;
case "Date Created":
displayTablePropertySelected(itemsArray);
break;
case "Date Last Used":
loadDLU(questionList);
break;
case "Number of Launched Surveys Used In":
loadNLSU(questionList);
break;
case "Number of Reponses":
loadNR(questionList);
break;
case "Type 1 Associations":
loadT1A(questionList);
break;
case "Type 3 Associations":
loadT3A(questionList);
break;
case "Sites Linked To":
loadSLT(questionList);
break;
case "Last Modified By":
displayTablePropertySelected(itemsArray)
break;
default:
break;
}
}
showResult();
}
Each function in "CASE" contains an ajax call. I need to use asynchronous calls .
I want to run the showResult () function after completing AJAX in all functions. Different AJAX take different time frames.
Please help me find a solution to this situation.
source
share