My data seems to be an array of arrays I want to loop over it and use the data
If I debug:
console.log(alldata);
This is how the data looks
- Why does it say "Data" ?
- I cannot seem to get the data to display
This For Loop does not work
for (var i = 0; i < alldata.length; i++) {
console.log(alldata[0]);
}
I would think that the length on that object would be "ok" , what am I doing wrong?
Also I have been trying a different type of loop with $.each and I'm not understanding the indexing
alldata, index, query ... I know that query will contain the contain but I wish to loop over them .
It does not seem that I can do query[index][0] and I don't know why.
Here is where I attempt to loop and add to a variable
$.each(alldata, function (index, query) {
//console.log(alldata);
//console.log(index);
//console.log(query);
//console.log(query[0][0]);
//console.log(index);
strData += "<tr>";
strData += "<td>" + query[0][0] + "</td>"; //+ query.outage_k + "</td>";
strData += "</tr>";
});
Update:
I added in another column from the database table to get returned and what I currently see is
122461,4876192
As now I have 2 records
So with that is shows
$.each(alldata.Data, function (index, query) {
strData += "<td>" + query + "</td>";
}
That is spitting out 122461,4876192 how do I use "query" for separation?
I want to end up doing this
<td>122461</td><td>4876192</td>


alldata.Data.