i have an returned data from an php function as the following :
data[0]
[0]
<table>
....
</table>
[1]
<table>
....
</table>
.
.
.etc
data[1]
how can i loop through this array by javascript !
asked Jun 25, 2012 at 13:30
uno-2017
5291 gold badge9 silver badges27 bronze badges
-
1what have you tried? please explain the mix of array and html, what exactly is the data type?charlietfl– charlietfl2012年06月25日 13:51:43 +00:00Commented Jun 25, 2012 at 13:51
1 Answer 1
It would be possible to have a nested jQuery foreach function.
$.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>
});
});
Sign up to request clarification or add additional context in comments.
Comments
default