I have this JSON and I don't know how to access to elements in productList . This is the JSON
[
{
"id": 1,
"name": "sala1",
"deleted": "NODELETED",
"sectionList": [
{
"id": 1,
"name": "seccion1",
"methodList": [],
"frecuencyList": [],
"productList": [
{
"id": 1,
"name": "lejia",
"deleted": "NODELETED"
},
{
"id": 3,
"name": "agua",
"deleted": "NODELETED"
},
{
"id": 4,
"name": "cal",
"deleted": "NODELETED"
}
],
"deleted": "NODELETED"
},
{
"id": 2,
"name": "seccion2",
"methodList": [],
"frecuencyList": [],
"productList": [
{
"id": 1,
"name": "lejia",
"deleted": "NODELETED"
}
],
"deleted": "NODELETED"
}
]
}
]
I'm using this :
$.getJSON('my url' , function(data) {
$.each(data , function(key, val)
{
console.log("Value of ProductList-> " + data['productList'].name );
});
});
Please is the first time that I use JSON with other arrays inside and I'm lose. Thank to all !!!