i have problem..
for(a=1;a<10;a++){
$(\".div\").append(\"\")
$.ajax({
url: \"file.php\",
A good solution to this is to use a recursive function.
function appendDivs(limit, count) {
count = count || 1;
if (count <= limit) {
$(".div").append("");
$.ajax({
url: "file.php",
data: "a=" + count,
type: "POST",
async: true,
success: function(data) {
$("#" + count).html(data);
appendDivs(limit, count + 1);
},
error: function(e) {
alert('Error - ' + e.statusText);
appendDivs(limit, count + 1);
}
});
} else {
return false;
}
}
appendDivs(10);