用eval转化对象
var str = '{"name": "tom","age": 12,"sex": "man"}'; var obj = eval("("+str+")"); console.log(obj); // {name: "tom", age: 12, sex: "man"} console.log(typeof obj); // object
var str = '{"name": "tom","age": 12,"sex": "man"}'; var obj = eval("("+str+")"); console.log(obj); // {name: "tom", age: 12, sex: "man"} console.log(typeof obj); // object