I'm trying to get the data inside of "attributes" in these json format, but I always get undefined
{ "data": [
{ "attributes":
{
"id":"4977",
"book_id":"651284829",
"provider_id":"1",
"title":"\u96e8\u8272\u30b3\u30b3\u30a2",
"author":"IAM, K.K.",
"price":"170.00",
"rating":"4"
},
...
}
}
This is my code which always returns undefined:
for ( var obj in json.data) {
var att = obj.attributes;
html += "<p>" + att.author + "</p>";
}