I request your answer for a issue I've got (part is an array):
for(i=1;i<part.length;i++){
$("#content").append('<div id="id' + i + '"></div>');
$.get('ajax.php?id=' + i, function(data) {
console.log("cache" + i);
$("#id" + i).html(data);
});
});
The problem is that into $.get function, the i value is the value of I when the loop is ended. As there are 140 row in my Array (part), I will always be 140, not 1 then 2 then 3 ..
How to get the i value in the ajax callback ?
Thanks for reply.