I've a bug, and I suspect is due to my bad knowledge of jQuery. The scenario is described in the snipped below:
var towait = [];
towait.push($.get('someurl',function(data){ dosomething...}));
towait.push($.get('someurl',function(data){ dosomething...}));
....
towait.push($.get('someurl',function(data){ dosomething...}));
$.when(towait).done(function(){ dosomething else});
Symptoms are that dosomething else
is executed before the dosomething calls ( maybe I'm wrong, I'm hunting a bug ) is my assumption correct? does the defferred appear to be joined in the when before the $.get(...,function(){}) is executed?
If so there is some way in changing this behavior?