$('#logoutButton').off("click").on("click", function () { $("#pass").val(""); window.localStorage.clear(); $.mobile.changePage("#login",null,true,true); });
In case you want backbutton to exit an app in one page and in other to act as a real back button you should use this:
document.addEventListener("backbutton", onBackKeyDown, false); function onBackKeyDown() { if($.mobile.activePage.is('#loginpage')){ navigator.app.exitApp(); // Exit app if current page is a login page } else { navigator.app.backHistory(); // Go back in history in any other case } }
To remove/prevent a backbutton event use this:
document.addEventListener("backbutton", function(e){ e.preventDefault(); }, false);
No comments:
Post a Comment