如何删除移动应用程序中的确认导航弹出窗口

How to remove confirm navigation pop-up in mobile app

当进行更改并重定向到其他页面时会发生这种情况,尤其是在登录或注销期间。 ondevice ready 的代码是,

      document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
    //alert("ready");
    navigator.splashscreen.hide();
   window.onbeforeunload = null;
}

请提出隐藏本机弹出窗口的方法..

在您的代码中添加以下行,

window.onbeforeunload = null;

这一行不需要放在 deviceready 事件侦听器中。它可以放在它在单击后退按钮或页面重新加载期间调用的函数上。