function1(someVariable, function() { function2(someOtherVariable); }); } function function1(param, callback) { ...do stuff callback(); }
$.when(function1()).then(function2());