Jquery mobile and PhoneGap: Reload page to get next item in database
- by Amy Sukumunu
I want to reload the page after the user swipe right to the next item in database (id will increment 1) but it is not functioning. It show the alert (ID+1) but the page still does not reload or changePage(same page) to get the new item.
$('#word').live( 'swipeleft', function( e ) {
alert( 'You swiped right!' );
if(parseInt(sessionStorage.currWord_ID) >= parseInt(sessionStorage.firstWordID) && parseInt(sessionStorage.currWord_ID) < parseInt(sessionStorage.lastWordID)){
sessionStorage.currWord_ID = parseInt(sessionStorage.currWord_ID) + 1;
alert("ID +1");
$.mobile.changePage($("#word"),{transition: "pop",reloadPage: true});
}
} );