[{"todo":"","date":"0000-00-00","name":"","id":"609"},
{"todo":"","date":"0000-00-00","name":"","id":"608"},
{"todo":"","date":"0000-00-00",""date":"2013-02-14","name":"janis rough","id":"630"}]
2nd output from firebug console exactly the same except has the word "object":
[Object { date="0000-00-00", id="609", todo="", more...}, Object { date="0000-00-00", id="608", todo="", more...}, Object { date="0000-00-00", id="607", todo=""}]The PHP code is correct. How can I fix it in the AJAX code how to remove the brackets?Maybe the word object only shows up in the console but if not how to remove that also?$.ajax({ url: 'form_handler1.php', contentType:"application/json; charset=utf-8", dataType : "json", success: function(data) { var checkbx ='<input type="checkbox" class="checkall" >'; //var delRow = '<input type="button" class="btnDelete">'; var delRow = '<div class="circle">x</div>'; var myTable ='<table id="table"><tbody id="tbody">'; myTable += '<\/tbody><\/table>'; myTable = $('#response').append(myTable).find('tbody'); console.log(data); $.each(data, function(idx,item) { var row = '<tr><td>'+checkbx + '</\td><td>'+ item.todo +'</\td><td>' + item.name +'</\td><td>' + item.date + '</\td><td>'+ delRow +'</\td></\tr>'; //appends row with id parameter for delete AJAX function //myTable.append(row).find('.circle').last().data('itemid',item.id); //ymyTable.append(row).find('.circle').div.container.attr('id',data('itemid',item.id)); });//end each var todocount = document.getElementById('table').rows.length; $("#todocount").html(todocount+' ' + 'Items left'); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); } }); //end AJAX