2

我一直试图让这个退出弹出工作。到目前为止,我可以让它在 FF、Chrome 和 Safari 的 Mac 上运行,但在 IE、FF、Windows 版 Chrome 中遇到了困难。这是我迄今为止尝试过的两个片段:

<script language=javascript>
function thankYou(){
var win=window.open("[url.com]", "_blank", "left=20,top=20,width=500,height=500,scrollbars=1"); win.focus();  }
</script>

<body onUnload="thankYou()">

<SCRIPT>
function thankYou() {

var ConfirmStatus = confirm("We would love to receive your feedback on your experience of this page. Would you like to complete our short survey?");

if (ConfirmStatus == true) {
window.open("[url]", "win", "left=20,top=20,width=500,height=500,scrollbars=1");
} else {
window.close();
}

}

window.onunload=thankYou;
</SCRIPT>

不知道如何让它在 Windows 上运行。提前致谢!

4

1 回答 1

1

改变:

<body onUnload="thankYou()">

至:

<body onBeforeUnload="thankYou()">

和....

改变:

window.onunload=thankYou;

至:

window.onbeforeunload=thankYou;
于 2013-05-12T06:13:34.833 回答