i want to make multiple ajax requests using jQuery that appends table rows into a table but i want their response in order
for (i=0;i<5;i++) {
//variables tempString, start_value updated here after every loop iteration
$.post(
'results.php',
{start_value:start_value,tempString:tempString},
function(data3){
// alert(data3);
$('#data_table tbody tr:last').after(data3);
}
);
}
results.php returns a set of table rows with every request but they dont append to the table in the right order.
how do I make the next ajax requests wait till the first ones are finished?