如何使用javascript禁用“确定要离开此页面”弹出窗口

问题描述 投票:0回答:1

您好,我想禁用“确定要离开此页面弹出窗口”的弹出窗口。

<button class="btn @if($_GET['a']=="lp") btn-success @else btn-light @endif" title="Landing Page" @if($_GET['a']=="tp") data-vvveb-action="saveAjax" data-actiontype="tp#lp" data-redirect @endif>Landing Page</button>
<button class="btn @if($_GET['a']=="tp") btn-success @else btn-light @endif" title="Thank You Page" @if($_GET['a']=="lp") data-vvveb-action="saveAjax" data-actiontype="lp#tp" @endif>Thank You Page</button>

我有两个按钮登陆页面和谢谢页面。另请参阅图片:-https://i.stack.imgur.com/oTLz3.png

[当我单击“谢谢”页面时,其弹出“离开”站点弹出窗口。我要删除它。为此,我找到了以下代码:-

$(window).off('beforeunload.windowReload');

添加上述代码后,我的“谢谢”页面按钮不起作用,任何人都可以帮助我该怎么做。我的推荐链接是:-https://superuser.com/questions/705307/how-can-i-disable-are-you-sure-you-want-to-leave-this-page-popups-in-chrome/705308

javascript jquery google-chrome onbeforeunload
1个回答
0
投票

[以防其他人使用:我想在特定捐赠表单上将定期捐赠复选框(“我想每月捐出这笔款项”)设为真(选中)。我使用以下自定义JavaScript来做到这一点。

© www.soinside.com 2019 - 2024. All rights reserved.