function action1() { return $.ajax({}); } function action2() { return $.ajax({}); } $.when(action1()).then(action2, action1FailCallback);