日期:2014-05-16 浏览次数:20416 次
var band={ "name":"the sun", "members":[ { "name":[{"m":"shide","n":"yes"},{}], "role":"taiyang" }, { "name":"b", "role":"yueliang" }, { "name":"c", "role":"diqiu" } ], "year":"2009" } alert(band.members); alert(band.members[0].name[0].n) alert(band.members[0].role)
------解决方案--------------------
<script>
var ajosn={'name':'test','age':25,'country':'china'};
alert(ajosn.name);
</script>
这个就是josn数据,在服务器端echo json_encode($array);就可以啦