<script type="text/javascript"><!--var a=50,b="xxx";var arr="{id:"+a+",name:'"+b+"'}";arr=eval('('+arr+')');alert(arr.name);//--></script>
注:在字符串两端再加上括号然后eval就ok了