What I strongly recommend to use some sort of promise provider. For example, jQuery returns promise objects when you make ajax calls. If you use something like jQuery, you can do something like the following.
//
// all ajaxCall are jQuery ajax calls, which return a promise object.
//
$.when( ajaxCall1, ajaxCall2 ).pipe(function(result1, result2){
return ajaxCall3.done(function(result3){
// handle last bit of ajax.
});
});
Checkout jQuery's documentation for $.when and pipe. Pipe is a bit obscure to follow, but the example will get you started. There are other tools that give you promise functionality such as promisejs.
Thanks,
Miguel