我的 html 文件中有这个:
var jsonReturn = 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22YHOO%22%2C%22AAPL%22%2C%22GOOG%22%2C%22MSFT%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json';
var stockCount = jsonReturn.query.count;
Chrome 的调试器返回的错误:Uncaught TypeError: Cannot read property 'count' of undefined
这是 jfiddle:http: //jsfiddle.net/P6nMv/
这是 JSON 返回对象的片段:
**问题是为什么当我通过**正确解析它时它是未定义的jsonReturn.query.count