<script type="text/javascript"><!--var a=50,b="xxx";var arr="{id:"+a+",name:'"+b+"'}";arr=eval('('+arr+')');alert(arr.name);//--></script>
注:在字符串两端再加上括号然后eval就ok了
Powered by: 博客园 Copyright © 2024 ymmt Powered by .NET 9.0 on Kubernetes