0

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
  • 1
    Do you know if the site supports JSONP? Commented Sep 26, 2010 at 13:44

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.