2010年2月21日 星期日
Using YQL with JSONP – James Padolsey
Using YQL with JSONP – James Padolsey: "$.YQL = function(query, callback) { if (!query || !callback) { throw new Error('$.YQL(): Parameters may be undefined'); } var encodedQuery = encodeURIComponent(query.toLowerCase()), url = 'http://query.yahooapis.com/v1/public/yql?q=' + encodedQuery + '&format=json&callback=?'; $.getJSON(url, callback); }; // Usage: $.YQL('select * from rss where url='feeds2.feedburner.com/ajaxian' limit 1', function(data) { var post = data.query.results.item; alert(post.title); });"
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言