Is it possible to use $.when asynchronously:
init: function() {
console.log('begin');
$.when(
{async: true},
this.ajax1(),
this.ajax2(),
this.ajax3()
).done(function() {
console.log('success');
}, function () {
console.log('error');
});
console.log('end');
}
each ajax1, ajax2 or ajax3 can be either sync or async
For not it's not working then I expect, I want to see the next order in console output:
begin
end
success (or error)
But actual output is always:
begin
success (or error)
end