How can synchrony be forced in a javascript loop?
This is without synchrony :
$.each(data, function(index, value) {
alert(index + ': ' + value);
});
synchrony attempt :
var time = 500;
$.each(data, function(index, value) {
setTimeout(alert(index + ': ' + value), time);
time += 500;
});
but so far all it does is run the alert in a row, without interval
This is the ajax request that I need to run in a QUEUE :
$.each(data, function(key, val) {
$.ajax({
url: 'ajax/getPerson.php',
type:'post',
dataType: 'json',
data: { 'dude' : val["idG"] },
success: function(data) { createHTML.person(data) }
}