我试图做一个Ajax请求jQuery的Ajax错误{ “readyState的” 0 “responseText的”: “”, “状态”:0, “状态文本”: “错误”}
$.ajax({
type: "post",
url: "download.php",
error: function(data, status, err){
alert(JSON.stringify(data));
},
data: "fileid="+fileid
});
这请求提醒“{”readyState“:0,”responseText“:”“,”status“:0,”statusText“:”error“}”
我已经在谷歌搜索了所有我想出了一个十字网站ajax调用(这显然不是)
我已经尝试把完整的网址,它也做同样的事情。
我能想到的唯一的事情就是标题,我不知道会出现什么问题。下面是从萤火虫
Host www.mydomain.com
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0
Accept */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection keep-alive
Content-Type application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With XMLHttpRequest
Referer http://www.mydomain.com/
Content-Length 8
Cookie PHPSESSID=27b7d3890b82345a4fc9604808acd928
我添加了一个不同的页面上的其他请求的请求头和它工作得很好,但这个一直未能标题为其他请求:
Host www.mydomain.com
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0
Accept text/plain, */*; q=0.01
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection keep-alive
Content-Type application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With XMLHttpRequest
Referer http://www.mydomain.com/differentpage.php
Content-Length 33
Cookie PHPSESSID=27b7d3890b82345a4fc9604808acd928
你为什么不检查'err'? Firebug告诉你关于请求和响应的内容? –
当您使用相同的数据将假表单提交到同一页面时,会发生什么情况? –
err是一个空白字符串,是一个假表单工作得很好,但是这个ajax仍然不起作用 –