What I did was to build an object that would hold the results of each ajax request. I added on a function that would check when all the objects were populated, and then call the routine that would handle all the data.

Something like this (note I'm NOT using the ajax_queue plugin):

var ajaxQueue = {
  responses: [],
  checkDone: function() {
    //change the check value to match the number of expected responses
    if (this.responses.length == 3) {
      finishProcessing(this.responses);
    }
  }
}

//and then ajax calls something like this:
$.ajax({
  url: "somepage.php",
  success: function (data) {
    ajaxQueue.responses.push(data);
    ajaxQueue.checkDone();
  }
});

And then the "finishProcessing()" method does whatever is needed...

This got me past some significant performance issues from synchronous ajax calls (one ajax request initiated the next, etc.). But, I'm sure this is only one approach....

HTH

Shawn

partner56290674 wrote:
Hi folks,
   can anyone help me with some links to queuing up ajax requests
using jQuery please? I tried using the Ajax Queue plug-in (http://
plugins.jquery.com/project/ajaxqueue) but this wasn't much help
(errors).

is queuing now built into jQuery core?

cheers!

-me-

Reply via email to