var str ='{"a":"1","b":"2"}';var jsonstr =JSON.parse(str);console.log(jsonstr);console.log(jsonstr.a);console.log(jsonstr.b);输出结果: