title: How to make one AJAX request after a number of Backbone saves
body: <p>I have a situation where I need to save a Backbone model and then on its success iterate through a collection and save those and then on each of those successes iterate through another collection and save those and then after all those are complete perform one AJAX request.  This is what I have:</p>
  
  <pre><code>backboneModel.save(
      {},
      {
           wait: true,
           success: function (model1, response1)
           {
                $.each(backboneCollection1.models, function () {
                      this.save(
                          {},
                          {
                               wait: true,
                               success: function (model2, response2)
                               {
                                    $.each(backboneCollection2.models, function () {
                                         this.save(
                                             {},
                                             {
                                                  wait: true,
                                                  success: function (model2, response2)
                                                  {
                                                       //If i put the AJAX request here it will happen for every iteration which is not desired
                                                  }
                                             });
                                    });
                                }
                           });
                 });
                 //If i put the AJAX request here it will fire after one iteration of the first each even with async set to false on the AJAX request
           }
     });
  </code></pre>
  
  <p>Does anyone have any suggestions on where to perform this AJAX request so it only fires once after all of the backbone models have saved to the server?</p>