标签:
var str = ‘{ "name": "cxh", "sex": "man" }‘; //JSON字符串:
var obj = JSON.parse(str);; //由JSON字符串转换为JSON对象
console.log(obj)
var str2 = { "name": "cxh", "sex": "man" }; //JSON对象
var last=JSON.stringify(obj); //将JSON对象转化为JSON字符
console.log(last);
标签:
原文地址:http://www.cnblogs.com/andydao/p/4507368.html