Refer to the link : http://jsfiddle.net/LS8zs/
I tried to get JSON data using jQuery .ajax() from api of Kongregate.com
“Get User Badges” works. (plz click to try)
But “Get All Badges” doesn’t.
Code is basically the same. But error occurs:
parsererror : Error: jQuery17209025343011599034_1339162861022 was not called
I also tried to add ?callback=foo to the end of the URL, but no luck.
Would some body help me please?
I’m newbie in programming. I think I miss something about same origin policy, right?
Or the api just doesn’t support ajax call via javascript/jQuery?
Note that I’m using Ruby On Rails 3.2 to develop the web app. Should I use ROR to get JSON data instead? (In the best practice)
Thanks in advance.
Just typing:
http://www.kongregate.com/badges.json?callback=foo
into a browser doesn’t return JSONP. But it does for:
http://www.kongregate.com/accounts/andrew/badges.json?callback=foo
So I’m guessing JSONP callbacks aren’t supported for the first URL at all.
The Same Origin Policy shouldn’t matter if jQuery is handling the JSONP request correctly.