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.)
精彩评论