循环遍历多维数组jquery

uno*_*017 3 javascript php jquery

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

data[0]
     [0]
       <table>
        ....
       </table>
     [1]
       <table>
        ....
       </table>
       .
       .
       .etc
 data[1]
Run Code Online (Sandbox Code Playgroud)

我怎样才能通过javascript循环遍历这个数组!

小智 5

有可能有一个嵌套的jQuery foreach函数.

$.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>
  });
});
Run Code Online (Sandbox Code Playgroud)