js 字符串转对象

  • 使用eval
var test = '{ colkey: "col", colsinfo: "NameList" }'    
var obj2 = eval("("+test+")");  
alert(obj2.colsinfo);  

posted on 2018-03-13 16:35  cag2050  阅读(139)  评论(0编辑  收藏  举报

导航