Hi guys why i have net::ERR_EMPTY_RESPONSE
error when i trying to request JSON with jQuery ?
as you see if you try url in your browser its work very well but with ajax request have this error please someone tell me how i can fix my problem?
try in your browser:
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/