Moemonty
Moemonty

Reputation: 109

Retrieving JSON with JQuery

I'm trying to retrieve JSON with JQuery from: http://www.chirpradio.org/json

How do I retrieve, parse and display that JSON in a web page.

I'm new to JSON and JQuery, and the onsite documentation is a bit difficult to follow.

Thanks,

Moemonty

Upvotes: 0

Views: 242

Answers (1)

tcooc
tcooc

Reputation: 21209

One way to get past the SOP is to use a proxy(which also converts it into JSONP). i.e.:

var url = "http://www.chirpradio.org/json";
jQuery.getJSON("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%3D%22"+url+"%22&format=json&callback=?", function(data){
console.log(data.query.results.json);/*where yahoo puts the json object*/
});

However, I suggest not to query w/sensitive information(it's insecure). Your use with the radio feed is ok though.

Upvotes: 1

Related Questions