开发者

jQuery YQL json parse trouble

I am trying to parse json from a request, but I keep getting nu开发者_StackOverflowll. When I do console.log(data), it prints null.


$.ajax({
    url: "http://query.yahooapis.com/v1/public/yql",
    dataType: "jsonp",
    success: function(content) {
        var data = jQuery.parseJSON(content);
        console.log(data);
    }, data: {
        q: 'select * from html where url="http://www.google.com"',
        format: "json"
    }
});


I think that your "content" is probably already parsed for you by jQuery. What happens when you:

console.log(content);

??

(Actually now that I think of it the content is parsed by the browser when it receives the response script body.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜