如何在JavaScript中从URL获取JSON?
此URL返回JSON:
{ query: { count: 1, created: "2015-12-09T17:12:09Z", lang: "en-US", diagnostics: {}, ... }}
我试过这个,但它不起作用:
responseObj = readJsonFromUrl('http://query.yahooapis.com/v1/publ...');var count = responseObj.query.count;console.log(count) // should be 1
如何从此URL的JSON响应中获取JavaScript对象?
相关分类