字符串转json

str = '{a:2,b:3}'
json1 = eval( '(' + str + ')' )
console.log json1

console.log JSON.parse(str)

from:http://snandy.iteye.com/blog/615216

posted @ 2013-05-03 09:45  邓维  阅读(196)  评论(0编辑  收藏  举报