转:http://www.cnblogs.com/worfdream/articles/1956449.html
http://zhidao.baidu.com/link?url=Ozbqc9Q1Vt5o2BjecyW4lKKK6JBhLzxbPXRtYbGCNHX6s_Zjdn1dFCu-aZdH5Hv1SSZm1Dl-iC4GTzBRDz7tNK
http://lzw.me/a/html5-localstorage.html
<script>
var jsonstr = '{ "name": "cxh", "sex": "man" }';
alert(typeof(jsonstr));
var obj = JSON.parse(jsonstr); //由JSON字符串转换为JSON对象
alert(typeof(obj));
var obj = eval('(' + jsonstr + ')');
alert(typeof(obj));
var str2 = { "name": "cxh", "sex": "man" };
alert(typeof(str2));
alert(str2.name);
var jsonstr="[{'name':'a','value':1},{'name':'b','value':2}]";
var jsonarray = eval('('+jsonstr+')');
var arr =
{
"name" : "test",
"value" : 100
}
jsonarray.push(arr);
console.log(jsonarray);
</script>