【发布时间】:2014-09-09 10:04:01
【问题描述】:
var json = [{
"id": "702",
"nid": "1",
"node_count": "211",
"sdata": "100",
"stype": "1",
"timestamp": "2014-04-04 09:00:42"
}][{
"id": "697",
"nid": "2",
"node_count": "218",
"sdata": "0",
"stype": "1",
"timestamp": "2014-04-0 4 08:41:05"
}][{
"id": "700",
"nid": "3",
"node_count": "217",
"sdata": "0",
"stype": "1",
"timestamp": "2014-04-04 08:41:52"
}][{
"id": "699",
"nid": "4",
"node_count": "33",
"sdata": "0",
"stype": "1",
"timestamp": "2014-0 4-04 08:41:46"
}][{
"id": "701",
"nid": "5",
"node_count": "23",
"sdata": "0",
"stype": "1",
"timestamp": "2014-04-04 08:42:20"
}]
$.each(json, function (arrayID, SensorData) {
alert('Node id' + SensorData.nid);
alert('SensorData' + SensorData.sdata);
alert('Sensor Type' + SensorData.stype);
alert('Time is ' + SensorData.timestamp);
});
【问题讨论】:
-
您的语法完全无效。此外,对问题的一些解释以及您想要实现的目标将有助于很多。
-
Rory 你能帮我如何检索数据
标签: jquery json jquery-templates