json字符串 转为 对象
var str = '{"id":1,"name":"Russel Westbrook","age":28}'; var strToObj = JSON.parse(str);
对象 转为 json字符串
var obj = { id: 1, name: 'Russel Westbrook', age: 28 }; var objToStr = JSON.stringify(obj);
var str = '{"id":1,"name":"Russel Westbrook","age":28}'; var strToObj = JSON.parse(str);
var obj = { id: 1, name: 'Russel Westbrook', age: 28 }; var objToStr = JSON.stringify(obj);