I'm working on a web-app in Node.JS.
In order to parse a dynamic JSON variable I have followed This Question
However I'm new to JSON and I have a particular JSON response coming from a Server. Here's a piece of JSON response
[{"results":[{"name":"AIENR","tags":{"ch":["922"],"mq":["EMPTY","REAL"],"vs":
["VALID"]},"values":[[1352934000000,145258],[1352934900000,145258],
[1352935800000,145259],[....]
The problem:
I want to access to fields inside "values"
, so in my html page I've done this:
<p>Values: </p>
<%for (var nodeIndex in queries[0].results[0].values) {%>
<p><%= queries[0].results[0].values[nodeIndex] %></p>
<%}%>
and the output (that is correct) is:
Values:
1352934000000,145258
1352934900000,145258
1352935800000,145259
1352936700000,145259
... , ...
Anyway, due to fact that the first value is a timestamp and the second value is a particular measure, I want to store them separately and maybe in the next days use those values to make a chart.
So my question is: How can I split those two values?
Best Wishes.