2017-07-19 11 views
0

ポップアップがブロックされないようにするにはどうすればよいですか?私がボタンをクリックするたびに、通知がポップアップし、私が言ったようにリダイレクトされると言います。しかし、クロムは、ポップアップがブロックされているので、新しいタブを開くことができないと言います。Window.Openがポップアップブロックされている、修正する方法?

$(function() { 
    $('#clickBtn').on('click', function() { 
     new Noty({ 
       type: 'success', 
       layout: 'topRight', 
       timeout: timeout, 
       text: '<p style="text-align: center">Redirecting in 5 
        seconds</p>' 
     }).show(); 

       var url = 'https://google.com', 
        delay = 5000; // Milliseconds: 1sec x 1000 

       setTimeout(function() { 
        window.open(url, '_blank'); 
       }, delay); 
     }); 
+0

がポップアップで使用される一般的な技術である。..ブラウザのポップアップをブロックしたりされていません広告。したがって、ブロックされます。 – Rajesh

+0

[もう1つ](https://stackoverflow.com/questions/9514698/bypass-popup-blocker-on-window-open-when-jquery-event-preventdefault-is-set)詳細はこちら[https://www.google.co.in/search?q=Window.Open+being+pop-up+blocked%2C+how+to+fix%3F&oq=Window.Open+ポップアップ+ブロック%2C + how + to +%3F&aqs = chrome..69i57j69i60.3130j0j7&sourceid = chrome&ie = UTF-8) – Rajesh

答えて

0

あなたは、ポップアップブロッカー、 を避けるカントしかし、あなたは確認することができ、コールバックの内側にリダイレクト

var windowName = 'userConsole'; 
var popUp = window.open('htttp://www.google.com', windowName, 'width=1000, height=700, left=24, top=24, scrollbars, resizable'); 
if (popUp == null || typeof(popUp)=='undefined') { 
    alert('Please disable your pop-up blocker and try again.'); 
} 
else { 
    popUp.focus(); 
} 

Check Here

関連する問題