I have the following JSON data:
0:[{"LoggerId":"1000651443","ReadingDate":"2018-12-05 00:03:03, "ReadingValue":"12.6", "Tooltip":"Someinfo"},
{"LoggerId":"1000651447","ReadingDate":"2018-12-05 00:04:03, "ReadingValue":"12.7", "Tooltip":"Someinfo"}]
1:[{"LoggerId":"1000651444","ReadingDate":"2018-12-05 00:03:05, "ReadingValue":"12.9", "Tooltip":"Someinfo"},
{"LoggerId":"1000651445","ReadingDate":"2018-12-05 00:03:07, "ReadingValue":"14.9", "Tooltip":"Someinfo"}]
2:[{"LoggerId":"1000651446","ReadingDate":"2018-12-05 00:03:17, "ReadingValue":"13.6", "Tooltip":"Someinfo"},
{"LoggerId":"1000651446","ReadingDate":"2018-12-05 00:04:17, "ReadingValue":"43.6", "Tooltip":"Someinfo"}]
I want to be able to loop through each array and all of its elements.
So far I can only loop through main array and not its contents.
success: function (d) {
var parsedData = $.parseJSON(d);
var objCount = Object.keys(parsedData).length;
$.each(parsedData, function (key, value) {
console.log[value.LoggerId, new Date(value.ReadingDate), Number(value.ReadingValue), value.ToolTip]
});
},
I have tried some nested loops, but I get object undefined as an error.
I want to loop through 0 and all of its elements and assign them, then 1, then 2 and so on...
TIA
"ReadingDate":"2018-12-05 00:03:05There is no closing quote