I don't know how to get the right value from Jquery .each? There are 3 name/value pairs: todo, date, user.
I just want the"todo" collection listed, for every row, but what I am getting is the first row values (todo, date, user)instead of a list of only todo values(do laundry, do shopping, ...). I don't think I need a nested .each but I want it to loop through each row in the object instead of loop through the first row values.
I found the json object came back from the json encoded ajax response as an array and to get rid of the brackets I had to do response[0]
var list_start ='<li "class" = "todo-list" >';
var list_end ='</li>';
var checkbx ='<input type="checkbox" id="task" checked="false" />';
var delRow ='<input type="button" value="Delete" class="btnDelete" onclick="deleteRow(this)" />';
//var respObj = response[0];
$.each(response[0], function(i,value) {
var row = list_start.concat(checkbx ,value, delRow, list_end);
alert(row);
$("ul").append(row);
});
}//end each
});//success end/ ajax end
thanks,