I have three different AJAX queries that I want to hit various services. When they’ve all come back (or timed out) I’d like them to call a function.
I can imagine lots of ways of doing this, like having an intermediate function count when all the requests have come in, but is there a beautiful solution?
jQuery allows you to do what you want. See
http://www.erichynds.com/jquery/using-deferreds-in-jquery/
Naturally this only works if you are using jQuery, or can use jQuery.