Skip to content Skip to sidebar Skip to footer

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 onsit

Solution 1:

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.


Post a Comment for "Retrieving JSON With JQuery"