我正在使用jQuery模板插件来显示来自Google Books API的JSON信息,以便在这里生成图书列表:http://jsfiddle.net/yuW6L
我可以使用模板标记从JSON中获取并显示基本信息,如标题
{{each items}}和
${volumeInfo.title}但ISBN嵌套在JSON的一部分中,如下所示:
...
"industryIdentifiers":[
{
"type":"ISBN_10",
"identifier":"1593374313"
},
{
"type":"ISBN_13",
"identifier":"9781593374310"
}我不能这样显示ISBN-10:
volumeInfo.industryIdentifiers.identifier[1]我不认为我可以这样做:
{{each items.volumeInfo.industryIdentifiers}}
...
${identifier}如何解析和显示ISBN-10?
发布于 2013-01-25 01:32:39
第一次尝试将索引放在错误的位置。industryIdentifiers是数组,所以把索引放在它后面。
volumeInfo.industryIdentifiers[0].identifier
https://stackoverflow.com/questions/14507228
复制相似问题