Combine Multiple Ajax Call Responses Using Deferred Objects in Backbone?
How can I load in the responses for each request? What I have below doesn't work. I think only .then will display success and error callbacks but I'm not sure how to pass in the actual responses. How can I do this?
$.when(CountryCollection.deferred, StatesCollection.deferred)
.then(function (resp1, resp2) {
console.log(resp1);
console.log(resp2);
//this callback will be fired once all ajax calls have finished.
});