I have jsons:
{id: 10, attr_id: 0, value: "1", extra: null, created_at: "2018-06-05 11:23:34", …}
{id: 11, attr_id: 0, value: "2", extra: null, created_at: "2018-06-05 11:23:50", …}
{id: 12, attr_id: 0, value: "3", extra: null, created_at: "2018-06-05 11:24:06", …}
All these jsons is on each function.
$.each(result, function(index, value) {
console.log(value); //I get jsons, which up
$.each(value, function(i, val) {
console.log(val.id); //Uncaught TypeError: Cannot read property 'id' of undefined
});
});
I get error:
Uncaught TypeError: Cannot read property 'id' of undefined.
How I can fix this problem?
UPDATE
I don't need do second each. I just need write value.id. All Working, but I get only first object. How I can get all objects?