I understand how to use $.each to go through JSON data which looks like this:
{
"one": "Singular sensation",
"two": "Beady little eyes",
"three": "Little birds pitch by my doorstep"
}
For example:
$.each(data, function(key, val) {
echo '<div>' + val + '-' + key + '</div>';
});
But how do I use $.each to go though JSON data which looks like this:
{
"d": [
{
"__type": "Tab",
"id": 1,
"name": "Innovation",
"ordering": 0
},
{
"__type": "Tab",
"id": 3,
"name": "Thought",
"ordering": 0
},
{
"__type": "Tab",
"id": 0,
"name": "Collaboration",
"ordering": 0
}
]
}
Where I want to use the id and name.
Use this:
If your
complex_datacontains more keys liked, use: