While working with PhoneGap I have created a SQLite database that stores the name and phone number along with an autoincrementing id field. I am using jQuery Mobile to fetch the result and display it in a listview, here is the code
function queryDB(tx){
tx.executeSql('SELECT * FROM DEMO',[],querySuccess,errorCB);
}
function querySuccess(tx,result){
$('#contactList').empty();
$.each(result.rows,function(index){
var row = result.rows.item(index);
$('#contactList').append('<li><a href="#"><h3 class="ui-li-heading">'+row['name']+'</h3><p class="ui-li-desc">Phone '+row['phone']+'</p></a></li>');
});
$("#contactList").listview();
}
Now I want that when the user tap on certain list element on the screen he be should taken to a new page. Along with that I want to pass the id of that user to the new page so that I can save more details in the DB using that ID. As I am new to JQM, I am not able to figure out how to do it