0
嗨,大家好,爲什麼我有net::ERR_EMPTY_RESPONSE
錯誤,當我試圖請求JSON與jQuery? 正如你看到的,如果你嘗試在瀏覽器中的網址它的工作很好,但與Ajax請求有這個錯誤,請別人告訴我,我可以解決我的問題?net :: ERR_EMPTY_RESPONSE當ajax請求
嘗試在瀏覽器:
http://uploads.im/api?upload=http://www.google.com/images/srpr/nav_logo66.png
JS:
url = 'http://www.google.com/images/srpr/nav_logo66.png';
$.ajax({
type: "POST",
cache: false,
dataType: 'json',
url: "http://uploads.im/api?upload="+url,
success: function(a) {
if (a.status_code === 200){
c = a.data;
alert(c.img_url)
alert(c.thumb_url)
} else if (a.status_code) {
alert('error');
} else {
alert('error2');
}
}
});
的jsfiddle:
https://jsfiddle.net/raminr63/bgu00oas/
參見後 - https://stackoverflow.com/questions/37835232/java-with-ajax-err-empty-response-ajax-response-throws-error-while-server -is/37983882#37983882?newreg = 374679a32c5f48bc9e7d37db6cd85548 –