I'm wanting to get the label item of this json and I can not get the list out empty or undefined, I think it's a mulitidimentional array and it's missing one more level, I can not build the correct code it's what I need help with this thanks.
JSON:
{
"entities": {
"categories": [
{
"horror": {
"id": 1,
"label": "Terror"
},
"comedy": {
"id": 2,
"label": "Comedia"
},
"drama": {
"id": 3,
"label": "Drama"
}
}
]
}
// SCRIPT
$(document).ready( function() {
$.getJSON("/books-schema.json",
function(data){
$.each(data.entities.categories, function(i,item){
$("<li>").html(item.label).appendTo("#categoria");
});
});
});