Ive got this code:
loadData : function(jsonArray) {
var id = $(this).attr("id");
for(var i in jsonArray) {
$("#"+id+" tbody").append('<tr class="entry-details page-1 entry-visible" id="entry-'+i+'"></tr>');
var header = {
1: "time",
2: "project",
3: "task"
}
var col = 1;
while(col <= jsonArray[i].length) {
$("#"+id+" tbody #entry-"+i).append("<td>"+jsonArray[i][header[col]]+"</td>")
col++
}}
It will take a JSON array that looks similar to the following
{"1":{"project":"RobinsonMurphy","task":"Changing blog templates","time":"18\/07\/11 04:32PM"},"2":{"project":"Charli...
The code should loop through the rows (which it does), and then loop through the colums of data.
The problem I am facing is in order to place the column data in the correct column, I need to calculate how many pieces of data are being returned in a row. I tried jsonArray[i].length, however this returns undefined.
Any help would be appreciated