Javascript windowsphone8&;Phonegap:如何使用后退按钮关闭应用程序
我使用phonegap创建Windows Phone 8应用程序 现在,我已完成所有操作,但无法使用“后退”按钮退出应用程序。Javascript windowsphone8&;Phonegap:如何使用后退按钮关闭应用程序,javascript,cordova,windows-phone-8,Javascript,Cordova,Windows Phone 8,我使用phonegap创建Windows Phone 8应用程序 现在,我已完成所有操作,但无法使用“后退”按钮退出应用程序。 我使用了navigator.app.exitApp();但它现在起作用了。 它在Windows Phone上工作吗 它在Android和Blackberry上运行。navigator.app仅在Android和Blackberry上可用。要使用“后退”按钮退出Windows Phone 8中的应用程序,您需要删除“后退”按钮事件处理程序 function onBackK
我使用了navigator.app.exitApp();但它现在起作用了。 它在Windows Phone上工作吗
它在Android和Blackberry上运行。navigator.app仅在Android和Blackberry上可用。要使用“后退”按钮退出Windows Phone 8中的应用程序,您需要删除“后退”按钮事件处理程序
function onBackKeyDown(e) {
e.preventDefault();
window.history.go(-1);
}
function onPageChange() {
if(window.location.hash != "#/") {
// add our event listener for sub pages, this will allow us
document.addEventListener("backbutton", onBackKeyDown, false);
} else {
// remove the event listener so the back button will exit the app
document.removeEventListener("backbutton", onBackKeyDown, false);
}
}
navigator.app仅在Android和Blackberry上可用。要使用“后退”按钮退出Windows Phone 8中的应用程序,您需要删除“后退”按钮事件处理程序
function onBackKeyDown(e) {
e.preventDefault();
window.history.go(-1);
}
function onPageChange() {
if(window.location.hash != "#/") {
// add our event listener for sub pages, this will allow us
document.addEventListener("backbutton", onBackKeyDown, false);
} else {
// remove the event listener so the back button will exit the app
document.removeEventListener("backbutton", onBackKeyDown, false);
}
}
我也面临着同样的问题。有人请帮忙……我也面临着同样的问题。有人请帮忙。。。。