eval( ‘o=‘+str );
alert(o.name);
JavaScript 将字符串转换为对象
原文:https://blog.51cto.com/weiyuqingcheng/2659985