var title = $("#title_show").text();
var content = $("#content_show").text();
$("#title_edit").val(title);
$("#content_edit").text(content);
$.mobile.changePage("#EditPage");
var new_title = $("#title_edit").val();
var new_content = $("#content_edit").val();
editMemo(id, new_title, new_content);
function editMemo(id, new_title, new_content){
var memo = MC.Collection("Memo");
memo.findMine(MC.Criteria("_id==?", [id]))
.done(function(items, totalItems)
items.items[0].title = new_title;
items.items[0].content = new_content;
.done(function(updatedItem)
console.log('Updating is success!');
//display a dialog stating that the updating is success
$( "#okDialog_edit" ).popup("open", {positionTo: "origin"}).click(function(event)
location.href='#ListPage';
.fail(function(err){ console.log(JSON.stringify(err)); return null; });
.fail(function(err){ console.log(JSON.stringify(err)); return null; });