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", "email": "science fiction" },   
                                        { "firstName": "Tad", "lastName": "Williams", "email": "fantasy" },
                                        { "firstName": "Frank", "lastName": "Peretti", "email": "christian fiction" }],   
                         "musicians":[  { "firstName": "Eric", "lastName": "Clapton", "email": "guitar" },
                                        { "firstName": "Sergei", "lastName": "Rachmaninoff", "email": "piano" },
                                        { "firstName": "Ranen", "lastName": "Tong", "email": "Ranen" }] 
                     }只需遍历显示9个firstName的值就行,

解决方案 »

  1.   


           $("#btnEachJson").click(function(){
                $.each(people,function(index,value){
                    $.each(value,function(index2,value2){
                        //只能进来3次,何解?必须用jQuery
                    });
                });  
           });
      

  2.   


      $.each(people,function(index,value){
                    $.each(value,function(index2,value2){
                         alert(value2.firstName);
                    });
                });你这样不就都拿出来了吗 ?
      

  3.   

    自己有点晕了,一直用people[index1][index2].firstName,总是找不出来,谢谢楼上,