Here is the JSON example:
jsonData:
{ "Device": { "Content": { "UL": { "index0": "12", "index1": "1", .... "index31": "5", } } } }
This is what I tried, but it didn't work:
var index = [];
var jsonDoc = JSON.parse(data);
for(var i =0; i<32 ; i++)
{
var $arr = "index"+i;
index.push( jsonDoc.Device.Content.UL.$arr);
}
How can I extract the index from 1 to 31 and put it in the index array?