110,561
社区成员
发帖
与我相关
我的任务
分享
// Assign handlers immediately after making the request,
// and remember the jqxhr object for this request
var jqxhr = $.get("example.php", function() {
alert("success");
})
.done(function() { alert("second success"); })
.fail(function() { alert("error"); })
.always(function() { alert("finished"); });
// perform other work here ...
// Set another completion function for the request above
jqxhr.always(function(){ alert("second finished"); });
以上来自:
http://api.jquery.com/jQuery.get/
fail的声明
jqXHR.fail(function(jqXHR, textStatus, errorThrown) {});