我有以下无法正常工作的代码。
$.when,在动作完成之前很久就立即返回.done
。如何将操作推迟到.done
完成?
var getReturn = function() {
$.post("/app/return.php", { auth: auth })
.done(function(data) {
// Does some calculations, does not return values
});
}
$.when(getReturn())
.done(function(response1) {
console.log('fire');
});