json字符串转json对象,调用parse方法: var b='{"name":"2323","sex":"afasdf","age":"6262"}'//json字符串 var bToObject=JSON.parse(b); console.log(bToObject.name);//2323
json对象转为json字符串: var a={"name":"tom","sex":"男","age":"24"}//json对象 var aToString=JSON.stringify(a); console.log(aToString);//{"name":"tom","sex":"男","age":"24"}