views:

62

answers:

1

Hello all. 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

+1  A: 

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.

digitalFresh
This works. But what are the drawbacks to this? Are there any tutorials for using JSONP you would recommend? Thank you.
Moemonty
JSONP is basically JSON and a function, which is javascript. Heres a link to the JSONP proposition(if it may help): http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/
digitalFresh
Thanks for pointing me in the right direction all!
Moemonty