아약스 요청을하려고합니다.jquery ajax error { "readyState": 0, "responseText": "", "status": 0, "statusText": "error"}
$.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 "}"
Google에서 검색 한 모든 크로스 사이트 아약스 호출 (이것은 분명히 아닙니다)입니다.
전체 URL을 넣으려고했는데 똑같은 일을합니다.
내가 생각할 수있는 유일한 것은 헤더이고 나는 그것으로 무엇이 잘못 될지 모른다. 다음은 firebug의 요청 헤더입니다.
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
왜 '오류'를 조사하지 않습니까? Firebug는 요청 및 응답에 대해 무엇을 알려 줬습니까? –
가짜 양식을 동일한 데이터로 동일한 페이지에 제출하면 어떻게됩니까? –
err이 빈 문자열이고 예 가짜 형식이 제대로 작동하지만이 아약스가 여전히 작동하지 않습니다 –