I came across this one. I have objects and I cycle the request to the server:
var obj=$("table tr"); obj.each(function(){ $.post("index.php",{$(this).attr("id")},function(data){ alert(data); }); });
How to achieve that the cycle did a delay yet did not receive the answer from the server? That is, the next cycle step is performed when a response is received from the server.
UPD.
Recursion?
Or how in that case $ .map () will behave?
UPD2
var objs=$("table tr"); // length = 45 var i=0; function reload_all(obj){ if($(obj).attr("id")==undefined)return true; $(".reload_all_field").append($(obj).attr("id")+"|"+i+" "); i++; reload_all($(obj).next()); } reload_all(objs); // после обхода i = 38 вместо 44
I did it this way, but out of 45 objects only 40 are processed. 5 pieces are skipped after the 5th. What is the problem? Can I use .next () for other purposes? ((