February 13, 2009

AJAX MultiCompleter

We recently needed to fire off a bunch of Prototype AJAX requests at once and be informed when they’re all finished. This simple class handles that for you. (Requires Prototype, of course.)

Download Ajax.MultiCompleter

Example
var c = new Ajax.MultiCompleter({
  onComplete: function(){ alert("all jobs done") },
  onSuccess: function(){ alert("all jobs were successful") },
});
// start off your requests
new Ajax.Request(url, { multiComplete : c });
new Ajax.Updater(url2, someDiv { multiComplete : c });
new Ajax.Request(url3, { multiComplete : c });
// tell it we're done adding
c.finishedAdding();

- 2 comments by 1 or more people Not publicly viewable

  1. james hughes

    that wasn’t funny at all. your standards are slipping.

    13 Feb 2009, 16:32

  2. Nick Howes

    Thanks Jam Hug. Hope you’re well. I deleted your three duplicate comments for you.

    16 Feb 2009, 08:35


Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

February 2009

Mo Tu We Th Fr Sa Su
Jan |  Today  | Mar
                  1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28   

Search this blog

Tags

Galleries

Most recent comments

  • Hey thank you for this post. It might need a bit updating, but it helped me a lot to find the right … by Alex on this entry
  • Logging is another prime use for AOP good article. by Nick Howes on this entry
  • Hi, another basic AspectJ Spring example can be found here http://www.developers–blog.org/blog/defau… by Rafael on this entry
  • Thanks Jam Hug. Hope you're well. I deleted your three duplicate comments for you. by Nick Howes on this entry
  • that wasn't funny at all. your standards are slipping. by james hughes on this entry

Blog archive

Loading…
Not signed in
Sign in

Powered by BlogBuilder
© MMXIV