js 字符串转对象

  • 使用eval
var test = '{ colkey: "col", colsinfo: "NameList" }'    
var obj2 = eval("("+test+")");  
alert(obj2.colsinfo);  
原文地址:https://www.cnblogs.com/cag2050/p/8558445.html