开发者

jQuery YQL json parse trouble

开发者 https://www.devze.com 2023-03-02 20:04 出处:网络
I am trying to parse json from a request, but I keep getting nu开发者_StackOverflowll. When I do console.log(data), it prints null.

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

精彩评论

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