Using JQuery getJSON method

Posted by nav on Stack Overflow See other posts from Stack Overflow or by nav
Published on 2010-04-08T23:13:08Z Indexed on 2010/04/08 23:23 UTC
Read the original article Hit count: 471

Filed under:
|
|

Hi,

I am attempting to pase a a JSON data using the JQuery getJSON function. The REST query is:

http://query.yahooapis.com/v1/public/yql?q=select%20woeid%20from%20geo.places%20where%20text%20%3D%20%22london%22&format=json&jsoncallback=?

The script I'm using to parse 'data' to obtain the WOEID value doesnt seem to work below:

 $.getJSON("http://query.yahooapis.com/v1/public/yql?"+
                "q=select%20woeid%20from%20geo.places%20where%20text%20%3D%20%22"+
                "london"+
                "%22&format=json&jsoncallback=?",
        function(data){
  console.log("json: " + data);
  var datatmp = data;
          if(data.results[0]){
            var data = filterData(data.results.place[0]);
           }
         }
       );

Can anyone say what I'm doing wrong? link text

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about getjson