只是console.info
this
在回调中
onFailure
-
this.status
包含HTTP错误响应。
this.xhr
包含有关请求和扩展响应的更多信息。
http://www.jsfiddle.net/dimitar/NF2jz/365/
new Request({
url: '/secho/html/',
data: {
html: "<p>Text echoed back to request</p>" + "<script type='text/javascript'>$('target').highlight();<\/script>",
delay: 3
},
method: 'post',
onFailure: function() {
var error = "Error " + this.status;
switch (this.status) {
case 404:
error = "Document not found (404)";
break;
case 301:
error = "Object moved permanently (301 redirect)";
break;
case 302:
error = "Object moved temporarliy (302 redirect)";
break;
}
alert(error);
}
}).send();