Click here to Skip to main content
16,017,296 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
<script type="text/javascript">
        var pnr=863200;
        
            $(document).ready(function() {
                $(document).on('click','#search',function(){
                    
                    //alert('hi');
                     $.ajax({
                url: "http://127.0.0.1/pnrphp/pnr.php",
                type: "POST",
                data: 'pnrli='+pnr+'&action=pnrlist',
                dataType:"JSON",
                success: function(response) { 
                   // console.log(response);
                    //console.log(response['maindata'][1][0]);
                    
                    $.each(response,function(key,value){
                       
                       // });
                    //$('#result').html('');
                   //$('#result').append('Number: ' + response.maindata[0][0] + '<br />');
                       
                    } );
            }
             } );
               } );
                 } );
        </script>




How can i print the the below mainarray[1][0] to mainarray[1][12] in for each loop.

Object {maindata: Array[2], sum: Array[2], status: " CHART NOT PREPARED "}

maindata: Array[2]

0: Array[8]

1: Array[12]
0: "Passenger 1"
1: "W/L   25,RLGN  "
2: "RAC   42"
3: "Passenger 2"
4: "W/L   26,RLGN  "
5: "RAC   43"
6: "Passenger 3"
7: "W/L   27,RLGN  "
8: "RAC   44"
9: "Passenger 4"
10: "W/L   28,RLGN  "
11: "RAC   45"
Posted
Updated 5-Mar-14 22:30pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900