I am building a simple couchapp CRUD application. When I fetch a view, I get a 304 response from CouchDB. In futon, the same view returns documents. Below is the snippet where I am querying the view and appending the returned items to a div. In the javascript console, I get an error saying "Can not read property _id of null"
db = $.couch.db("itemly");
function updateItems(){
$("#all").empty();
db.view("itemly/byitemname",{ success: function(data){
for (i in data.rows){
$("#all").append( <div id=" + data.rows[i].value._id + " class ="itemrow"><span> +data.rows[i].value.name + "</span><span>"+data.rows[i].value.price + "</span><span>"+data.rows[i].value.category + "</span><span>"+ <a href="#" id=" + data.rows[i].value._id + " class = "edit"> Edit Item </a> +"</span><span>"+ <a href="#" id=" + data.rows[i].value._id + " class = "remove"> Remove Item </a> +"</span></div>");
}
}
});
}
}