[["2015-06-05 16:21:40","666"], ["2015-06-05 15:30:38","666"], ["2015-06-05 15:07:26","666"], ["2015-06-05 14:38:21","666"], ["2015-06-05 14:38:21","666"], ["2015-06-05 14:33:18","666"], ["2015-06-05 14:23:18","666"], ["2015-06-05 14:18:16","666"], ["2015-06-05 14:15:09","666"], ["2015-06-05 14:12:16","666"], ["2015-06-05 14:12:16","666"], ["2015-06-05 14:05:34","666"], ["2015-06-05 14:01:27","666"], ["2015-06-05 13:57:44","666"], ["2015-06-05 13:57:44","666"], ["2015-06-05 13:51:23","666"], ["2015-06-05 13:51:23","666"], ["2015-06-05 13:41:43","666"],]
(1)如何將這些數據取出來放到一個數組裡?
(2)如何將單個的數據:["2015-06-05 13:41:43","666"]以“,”分隔取出來,例如:我要取出後面這個數據“666”
轉為json對象就可以操作了,建議你最好將最後那個“,”去掉,搞標准點
var s = '[["2015-06-05 16:21:40","666"], ["2015-06-05 15:30:38","666"], ["2015-06-05 15:07:26","666"], ["2015-06-05 14:38:21","666"], ["2015-06-05 14:38:21","666"], ["2015-06-05 14:33:18","666"], ["2015-06-05 14:23:18","666"], ["2015-06-05 14:18:16","666"], ["2015-06-05 14:15:09","666"], ["2015-06-05 14:12:16","666"], ["2015-06-05 14:12:16","666"], ["2015-06-05 14:05:34","666"], ["2015-06-05 14:01:27","666"], ["2015-06-05 13:57:44","666"], ["2015-06-05 13:57:44","666"], ["2015-06-05 13:51:23","666"], ["2015-06-05 13:51:23","666"], ["2015-06-05 13:41:43","666"],]';
var o = eval('(' + s + ')');
for (var i = 0; i < o.length; i++)
alert(o[i][0] + '\n' + o[i][1]);