I haven't used defererds much and am trying to get 2 ajax calls I make and one that a plugin makes to synchronize:
function doSomething(arg){
doAjax1(arg);
doAjax2(arg);
$(selector).plugin({
callback: pluginCallback
});
}
function doAjax1(arg){
$.post( url1, data);
}
function doAjax2(arg){
$.post( url1, data);
}
function pluginCallback( ajaxResults){
// how to connect this with doAjax1 and doAjax2 to create one deferred for all
}
Wrapping the 2 "doAjax" functions in a $.when is easy enough, but I need the callback of the plugin ajax to be included
I've been playing with pipe() and promises but not getting my head straight on how to connect these 3 calls