Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error callback with {"readyState":4,"status":200,"statusText":"success"}

I have this url call. the url returns a json object as expected (direct browser call) but when I do that via ajax with the follow lines

$.ajax({
       url: url, 
       type: "GET",
       dataType:"jsonp",   
       success: function(data) {
          alert(data);
       },
       error : function(error) {
          alert("no good "+JSON.stringify(error));
       }
});

it returns me

no good {"readyState":4,"status":200,"statusText":"success"}

I know there's others similar questions on stackoverflow, but nobody seems solved it.

like image 786
Dario Rusignuolo Avatar asked Feb 05 '13 17:02

Dario Rusignuolo


1 Answers

That suggests that the HTTP request was successful but the attempt to parse the data was not.

i.e. that the data was not formatted as JSONP.

like image 198
Quentin Avatar answered Oct 06 '22 00:10

Quentin