我很难将数据附加到 JSON 文件中的元素。我有以下
这是我正在尝试使用的 jQuery -
$.ajax({
url: 'https://www.googleapis.com/books/v1/volumes?q=:isbn=0-13-727827-6',
dataType: 'json',
success: function(data){
$.each(data.items, function(index){
$(".tab1").append("<div>"+data.title+"</div>");
});
}
});
来自JSFiddle
你可以看到我错了!我希望从Item->volumeInfo->title
每次尝试引用节点 volumeInfo 时提取书名,我得到一个错误