Javascript 是否有任何属性可用于检查是否启用浏览器的弹出窗口阻止程序?比如navigator.cookieEnabled

Javascript 是否有任何属性可用于检查是否启用浏览器的弹出窗口阻止程序?比如navigator.cookieEnabled,javascript,jquery,html,Javascript,Jquery,Html,有navigator.cookieEnabled来检查cookies是否启用。同样,是否有任何属性来检查是否启用了浏览器的弹出窗口阻止程序 只需查找单行属性,如navigator.cookieEnabled function checkCookie(){ var cookieEnabled = navigator.cookieEnabled; if (!cookieEnabled){ document.cookie = "testcookie";

navigator.cookieEnabled
来检查cookies是否启用。同样,是否有任何属性来检查是否启用了浏览器的弹出窗口阻止程序

只需查找单行属性,如navigator.cookieEnabled

function checkCookie(){
    var cookieEnabled = navigator.cookieEnabled;
    if (!cookieEnabled){ 
        document.cookie = "testcookie";
        cookieEnabled = document.cookie.indexOf("testcookie")!=-1;
    }
    return cookieEnabled || showCookieFail();
}
//弹出式检查

 function checkForPopBlocker() {
     var testPop = window.open("", "","width=100,height=100");
     if (testPop === null) {
        alert("Please disable your popup blocker.");
     }
     testPop.close();
 }
//弹出式检查

 function checkForPopBlocker() {
     var testPop = window.open("", "","width=100,height=100");
     if (testPop === null) {
        alert("Please disable your popup blocker.");
     }
     testPop.close();
 }

只要浏览一下这个博客就可以得到详细的解释。然而,下面是绝对代码。我希望这能奏效

var windowName = 'userConsole'; 
var popUp = window.open('/popup-page.php', 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 click the "Open" link again.'); 
} 
else {  
    popUp.focus();
}

只要浏览一下这个博客就可以得到详细的解释。然而,下面是绝对代码。我希望这能奏效

var windowName = 'userConsole'; 
var popUp = window.open('/popup-page.php', 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 click the "Open" link again.'); 
} 
else {  
    popUp.focus();
}

嘿tq@Zulqurnain Huda,但我要求检查是否启用弹出窗口拦截器。。。!请再次检查second AnswerTQ的工作,即使我有一些JavaScript代码要检查,但这里我只是查看一些属性,就像navigator.cookieEnabled,只有一行Hey tq@Zulqurnain Huda,但我要求检查是否启用弹出窗口阻止程序。。。!请再次检查second AnswerTQ的工作,即使我有一些Javascript代码要检查,但这里我只是查看一些类似navigator.cookieEnabled的属性,只有一行tq@Abirami Murukesan的工作,即使我有一些Javascript代码要检查,但这里只是查看一些类似navigator.cookieEnabled的属性,只需一行TQ@Abirami Murukesan,即使我有一些Javascript代码要检查,但这里只是查看一些属性,就像navigator.cookieEnabled,只需一行