tags:

views:

92

answers:

0

Hello,

you have answered a question about parallel async ajax request several month ago (see your answer at the end of this text).

I have an another question regarding this: The browser (Mozilla or IE) allow only a limited number of parallel request. In my case, eg. the IE allow only 2 request, as a result, if the execution of the request takes long time, then the browser will be blocked. Even hover-effects - like changing background images - does not function.

Have you any idea for the solution.

Thank you in advance,

Zoltan

Try this solution, which can support any specific number of parallel queries:

var done = 4; // number of total requests var sum = 0;

/* Normal loops don't create a new scope */ $([1,2,3,4,5]).each(function() { var number = this; $.getJSON("/values/" + number, function(data) { sum += data.value; done -= 1; if(done == 0) $("#mynode").html(sum); }); });