Possible Duplicate:
json Uncaught SyntaxError: Unexpected token :
Does jsonp depend on server support, in order to return a correct response?
I got this request, and what I get back is js error.
$.getJSON('myURL?q=keyword&callback=?', function(data){console.log(data)});
even angular jsonp method isn’t working:
http://jsfiddle.net/neoswf/tckGG/5/
console >> js error: Uncaught SyntaxError: Unexpected token :
Does jsonp depends on some server implementations?
SOLVED!!!
This question is different from others cause no other answers speak about the proxy solution.
The server doesn’t return JSONP, it returns JSON. A JSONP result is a JSON result wrapped in a function call.
Example:
If you can’t make the server return JSONP, you would need a proxy server that requests the service and returns the JSON result wrapped as a JSONP result.
As it happens, I set up such a proxy a while ago, at jsonp.guffa.com, that you could use if you don’t have the ability to set up one yourself.
Demo: http://jsfiddle.net/Guffa/tckGG/6/