总结:将字符串转化json对象的三种方法:
1:var json = JSON.parse(str);//注意:属性和属性值都用双引号引住(使用单引号来套双引号,如果反过来写报错) 2:var json = eval("(" + str + ")"); 3:var json = (new Function("return " + str))();
附链接 :https://www.cnblogs.com/cherishnow/p/10918798.html
https://www.cnblogs.com/cherishnow/p/10918798.html