确定AJAX调用成功的正确方法是什么?确定AJAX调用成功的正确方法是什么?
我看到的prototype.js
return !status || (status >= 200 && status < 300);
和jQuery中:
// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
return !xhr.status && location.protocol == "file:" ||
(xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || xhr.status == 1223;
哪一个是正确的?如果我们不使用任何Javascript库,而是使用基本Javascript编写AJAX,我们应该使用哪一个?
/借调 - 我不会认为304成功,例如,应该导致另一个行为循环的行为,才能建立整体成功 – annakata 2009-05-29 11:11:23
他们都很好地建立了一个JavaScript库......但在看法上有所不同它是成功的 – 2009-05-29 17:51:32