javascript 把字符串转换为对象

function strToJson(str) {
var json = (new Function("return " + str))();
return json;
}

原文地址:https://www.cnblogs.com/jackspider/p/3830624.html