Reputation: 956
I'm trying to get the results for the term: 'german' from an api..
Unfortunately, I get error: 'Uncaught SyntaxError: Invalid or unexpected token'.
I see that there are html characters in middle dots in the overview
response..
and there are lots of \"
(it should escape the quates).
$.ajax({
type: 'GET',
url: url,
async: false,
jsonpCallback: 'testing',
contentType: 'application/json',
dataType: 'jsonp',
success: function(json) {
console.dir(json);
},
error: function(e) {
console.log(e.message);
}
});
This is my jsfiddle: http://jsfiddle.net/mrLkyx7j/
Thanks.
Upvotes: 0
Views: 4119
Reputation: 366
try this code
$.ajax({
type: 'GET',
url: url,
jsonpCallback: 'testing',
dataType: 'json',
success: function(json) {
console.log(json);
},
error: function(e) {
console.log(e.message);
}
});
Upvotes: 2