Posted By

crypticsoft on 03/02/11


Tagged

JSONP YQL


Versions (?)

yqlQuery wrapper function


 / Published in: jQuery
 

URL: http://thinkvitamin.s3.amazonaws.com/membership/code-samples/YQL_jQuery_Example.zip

Thanks to thinkvitamin.com for the wrapper / video! http://membership.thinkvitamin.com/library/tools/yql/javascriptjquery-example

  1. function yqlQuery(query, callback){
  2. var yqlURL = "http://query.yahooapis.com/v1/public/yql";
  3. var data = {
  4. q: query,
  5. format: 'json',
  6. env: 'store://datatables.org/alltableswithkeys'
  7. }
  8.  
  9. $.get(yqlURL, data, callback, 'jsonp');
  10. }
  11.  
  12. yqlQuery('select * from geo.places where text="Orlando"', function(response){
  13. console.log(response);
  14. })

Report this snippet  

You need to login to post a comment.