jQuery queue multiple JSON calls and callback
===

I got an array of artist names.
For each artist name i make an ajax json call to a webservice to get songs by this artist.

My question now is: How can i be sure, that all ajax requests are done (either success or fail).

I looked at [Deferreds][1] and [AjaxManager][2], but i cant implement it so that it runs (if it's the right method...)

My code looks something like:

    $.each(tf.suggestedArtists, function(index, artist){
      var url = tf.enBaseUrl + "song/search?api_key=" + tf.apiKey + "&format=json&artist=" + artist.name + "&bucket=id:spotify-WW&bucket=tracks"

      $.ajax({
        type: "GET",
        url: url,
        dataType: 'json',
      }).done(function( data ) {
        //...do some more stuff

It's not possible to do these calls async because of JSON and cross domain issues.


  [1]: http://api.jquery.com/category/deferred-object/
  [2]: http://www.protofunc.com/scripts/jquery/ajaxManager/