javascript解析JSON---将字符串转换为json对象

<script type="text/javascript">  
    var str = '{"name":"jack","age":21,"address":"shenzhen"}';  
    var jsonObject = eval('('+str+')');  
    alert("name="+jsonObject.name+",age="+jsonObject.age+",addess="+jsonObject.address);
 
</script>

posted @ 2013-08-03 12:23  嗨,你的益达~~~  阅读(256)  评论(0编辑  收藏  举报