0
我正在做一个AJAX请求。在我的onFail
事件Request
我赶上了XHR
对象。
该对象中包含代码的成员的名称是什么。
对于这个问题,我无法找到显示该对象成员列表的文档。如何从mootools中的XHR对象获取http返回码
我正在做一个AJAX请求。在我的onFail
事件Request
我赶上了XHR
对象。
该对象中包含代码的成员的名称是什么。
对于这个问题,我无法找到显示该对象成员列表的文档。如何从mootools中的XHR对象获取http返回码
just 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();