【发布时间】:2014-12-21 18:11:06
【问题描述】:
我正在尝试遍历行业标识符列表并保存类型和标识符值。
我已尝试使用以下代码,但输出未定义。
var url = "https://www.googleapis.com/books/v1/volumes/EXiMZwEACAAJ";
$.getJSON(url, function(data) {
var bookID = data.items[0].id;
var title = data.items[0].volumeInfo.title;
var industryIdentifiers = data.items[0].volumeInfo.industryIdentifiers;
$.each(industryIdentifiers, function(result){
var idType = result.type;
var idValue = result.identifier;
alert (idType + " = " + idValue);
});
});
【问题讨论】:
-
你能发布来自
Google API的响应JSON吗?
标签: jquery json parsing iteration jsonobject