How's it going,
Need some assistance, with some for loop and pausing. I did some research myself and I keep running into setTimeout() function but I need help understanding it more or if someone can help me out with how to implement it into my code or if there's another way.
$(document).ready(function() {
for(i=0; i<counter; i++)
{
dataCounter = i;
$.ajax({
url: 'file.php',
dataType: 'json',
data: {count: dataCounter},
error: function(){
alert('Error loading XML document');
},
success: function(data){
$("#contents").html(data);
}
});
}
});
I would like to know how to pause after my $.ajax function before going on to my next increment.
Please help! Thank you :)