I have this Json:
{
"version": "firstVersion",
"numberID": "3",
"totalIDs": [
{
"1": {
"subTot": "2",
"subTotID": {
"1": "aaa",
"2": "bbb"
}
},
"2": {
"subTot": "2",
"subTotID": {
"1": "www",
"2": "rrr"
}
}
}
]
}
I know how to get the value of version, numberID, but when I try to drill down to get totalIDs > 1 > subTot > value, I don't know how to do it.
Here the ajax call:
$.ajax({
url: url,
type: "GET",
dataType: 'json',
success: function (data) {
console.log(data.version);
console.log(data.numberID);
console.log(data.totalIDs); // problem is here, I don't know how to drill down further
}
});
Any help is really appreciated. Thanks in advance. John