检测URL更改并在即10及更高版本中打开自定义弹出窗口

detect URL changes and opening custom popup in i.e 10 and higher version

本文关键字:版本 自定义 窗口 URL 高版本 检测      更新时间:2023-09-26

我想在winow/tab关闭和url更改上打开一个调查链接,确认框为"确定/取消"。需要将用户重定向到点击"确定"按钮的调查链接。我使用的代码如下:

function ConfirmClose(e) {
   if (!e) e = window.event;   
   e.cancelBubble = true;
   if (e.stopPropagation) {
    e.stopPropagation();
    e.preventDefault();
   }
   if (e.clientY < 0)
   {
    var leave_message ="Wait! Would you like to respond to a quick Survey";
    if (confirm(leave_message)) {
    window.open("www.surveylink.com");
    }
  }
}
window.onbeforeunload = ConfirmClose;

它在8,9时工作良好。但不适用于firefox、chrome和更高版本的即,请建议。

检查窗口上的Armins应答。卸载在Chrome浏览器中无法正常工作。有人能帮我吗,Chrome在onunload事件期间禁止某些功能,这些功能也是confrim框。您可以通过返回一个字符串来弹出一个对话框,然后该字符串将被确认/取消,并返回到页面离开/停留。