JSにおけるjsonデータフォーマットの評価例

4031 ワード

<html>

<head>

<title>Json      </title>

<meta http-equiv="content-type" content="text/html;charset=utf-8" />

<script type="text/javascript">

 var pepole={

        "pragrammers":[

    {"name":"  ","age":"6"},

    {"firstname":"  ","age":"79"}],

        "write":[

    {"name":"   ","time":"2012-04-10"},

    {"love":"cat","time":"2012-09-43"}

        ],

    "pig":"    "

        

 

 }

 window.alert(pepole.pragrammers[1].firstname);//      

 window.alert(pepole.pig);//      

 alert(pepole.write[1].love);//  cat

</script>

</head>

<body>

</body>

</html>