3
如何使用jQuery的$.post
推遲?我想:
var myFunc = function(data, textStatus, jqXHR) {
console.log(data);
};
var post = $.post("/url/", someData);
$.when(post).done(myFunc);
通常
$.post("/url/", someData, function(data) { myFunc(data) });
工作正常(改變myFunc
簽名後)。
$.when...
不起作用,沒有錯誤顯示我失敗。 .done()
函數到底是什麼myFunc
?
不需要[$ .when](http://api.jquery.com/jQuery.when/),但它也不應該受到傷害。 – Tgr
啊,我明白了。謝謝。 – ash