循环遍历多维数组 jQuery


loop through multi dimensional array jquery

我有一个从php函数返回的数据如下:

data[0]
     [0]
       <table>
        ....
       </table>
     [1]
       <table>
        ....
       </table>
       .
       .
       .etc
 data[1]

我怎样才能通过JavaScript循环这个数组!

可以

有一个嵌套的jQueryforeach函数。

$.each(data, function(key, value) { 
  //this is each data... data[0], data[1]... etc, the value being value and the index being key.
  $.each(key, function(innerKey, innerValue){
    //this is where your tables are. innerKey being the index innerValue being the value.
    <table>
    ...
    </table>
  });
});