<script>
 
    var jsontext = '{"name":"Loli","age":"12","phone":["091314520","021314520"]}';
    var c = JSON.parse(jsontext);
    document.write("名子:" + c.name + "<br>");
    document.write("年齡:" + c.age + "<br>");
    document.write("手機:" + c.phone[0] + "<br>");
    document.write("電話:" + c.phone[1] + "<br>");
 
</script>
 
 ------------------------------------------------------------------------------
輸出結果:

名子:Loli
年齡:12
手機:091314520
電話:021314520




arrow
arrow
    全站熱搜

    黃彥霖 發表在 痞客邦 留言(0) 人氣()