字符串转Javascript JSon数组

字符串转Javascript JSon数组
<script type="text/javascript">
 var str   = '[ {"green":10,"size":5,"strock":12},{"green":10,"size":2,"strock":20} ]';
 var json = eval(str);
alert(json[1].size);
</script>

你可能感兴趣的:(字符串转Javascript JSon数组)