簡體   English   中英

使用Respone重定向退出彈出窗口

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM