![](/img/trans.png)
[英]Exit Popup Redirect but only execute on exit not on clicking any other html redirect button on page
[英]Exit Popup With Respone Redirect
我需要在我们的其中一个处理页面上显示退出弹出窗口。 我通过注册客户端javascript来显示退出弹出窗口
window.onbeforeunload = ShowExitPopUp();
如果您关闭窗口或尝试键入其他URL,则弹出窗口可以正常执行。 但是,问题在于,一旦处理完成,我的处理页面也在服务器端执行“ Response.Redirect”。 当response.redirect发生时,exitpopup也会显示。 在这种情况下,有没有办法使退出弹出窗口不显示?
这是我正在使用的代码
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.Event.subscribe('comment.create',
function (response) {
window.location = "http://domain.com";
});
FB.Event.subscribe('comments.remove',
function (response) {
window.location = "http://domain.com";
});
};
(function() {
var e = document.createElement('script');
e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
//]]>
</script>
<script type="text/javascript">
var ShowExitPopup = true;
function ExitPage()
{
if (ShowExitPopup)
{
ShowExitPopup = false;
location.href = "http://www.YOURURL.com/destination";
return '****************************************\n\YOUR HEADLINE\n\n YOUR TEXT1 \n\n YOUR TEXT "\n\n | |\n | |\n V V\n 96+ v\n ********************************************************\n';
}
}
</script>
if (document.getElementById('<%=Panel.ClientID %>').style.display == "") {
$find("<%= Popup.ClientID %>").hide();
document.getElementById("<%= btncloseAcc.ClientID %>").click();
}
尝试这个..........
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.