json

    <script type="text/javascript">
var people = { 
    "programmers": 
    [ 
        { "firstName": "Brett", "lastName":"McLaughlin", "email": "aaaa" },
        { "firstName": "Jason", "lastName":"Hunter", "email": "bbbb" },
        { "firstName": "Elliotte", "lastName":"Harold", "email": "cccc" }
    ],
    "authors": [
        { "firstName": "Isaac", "lastName": "Asimov", "genre": "science fiction" },
        { "firstName": "Tad", "lastName": "Williams", "genre": "fantasy" },
        { "firstName": "Frank", "lastName": "Peretti", "genre": "christian fiction" }
    ],
    "musicians": [
        { "firstName": "Eric", "lastName": "Clapton", "instrument": "guitar" },
        { "firstName": "Sergei", "lastName": "Rachmaninoff", "instrument": "piano" }
    ]
    };
    alert(people.programmers[0].lastName);
    </script>

 

posted @ 2013-10-11 10:59  yufenghou  阅读(142)  评论(0)    收藏  举报