我的本地存储文件中有1个条目
10/10/2014 19:23:34
(日期和时间)作为密钥和
{"entries":[{"name":"s","contact":"s","location":"s","email":"sweety@yahoo.com","detail":"s","f_name":"form1"}]}
(表单字段记录)作为值
所以我的问题是如何使用Name = s
,Contact = s
等分隔参数来获取此数组...
答案 0 :(得分:0)
如果您还没有解析数据,可以这样解析:
var json = localStorage.getItem('10/10/2014 19:23:34');
if (json) {
var data = JSON.parse(json);
if (data !== null) {
// then you can try to do something with the data within it
var entries = data.entries;
for (var i = 0, l = entries.length; i < l; i++) {
var entry = entries[i];
console.log(entry.name, entry.contact, entry.location, entry.email);
}
}
}