jquery中如何获取相应信息的状态码? 如题,要用ajax发送一个请求然后判断响应的状态码做一些操作,如何才能获取状态码? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Demo:$.ajax({ url: "/echo/xml/", type: "POST", data: { //Set an empty response to see the error xml: "<response></response>" }, dataType:"text xml", success: function(xml, textStatus, xhr) { console.log(arguments); console.log(xhr.status); }, complete: function(xhr, textStatus) { console.log(xhr.status); } }); 我做了实验,如果是有错误不是正常返回200,那么xhr.status是error,不是具体的状态码啊 this和e.target 哪个效率高? js 验证 在下面代码上修改。怎么在图片下加个格导航【1】【2】【3】【4】【5】?解决加分 代码问题 jquery hover给div加边框后高度问题 如何获得在按下Del键后要删除的内容? 请问谁有梅花雪的pagecontrol(MzPageControlTop)控件? 请求各位前辈推荐一本学习JavaScript的书籍!! jQuery $([])是什么意思? 100'求:控制浮动层开关的代码,难度有点高 jquery鼠标经过离开和点击离开事件发生冲突了 javascript怎么写类似flash的那种遮罩效果
$.ajax({
url: "/echo/xml/",
type: "POST",
data: {
//Set an empty response to see the error
xml: "<response></response>"
},
dataType:"text xml",
success: function(xml, textStatus, xhr) {
console.log(arguments);
console.log(xhr.status);
},
complete: function(xhr, textStatus) {
console.log(xhr.status);
}
});