我發現了jQuery POST請求的以下代碼。我不明白大括號,是不是已經在調用.done函數之前關閉了?jQuery - POST請求的大括號
var jqxhr = $.post("example.php", function() {
alert("success");
})
.done(function() {
alert("second success");
})
.fail(function() {
alert("error");
})
.always(function() {
alert("finished");
});
,這就是所謂「方法鏈」 - http://schier.co/blog/2013/11/ 14/method-chaining-in-javascript.html – Biketire 2014-10-28 12:01:25