I have this bit of javascript that will detect popup browsers disabled and the javascript is working BUT I want to have a div show the error instead of just the browser alert, but I just can’t figure out why it’s my div is not showing up. Any help would be greatly appreciated. Thank you!
HTML:
<span id="popupBrowserAlert" style="background-color:#ffdd77;display:none;" >Your popup blocker is enabled</span>
JS:
var wPopup = 'newPopup';
var popUp = window.open('page url', wPopup, 'width=800, height=600, left=24, top=24, scrollbars, resizable');
if (popUp == null || typeof(popUp) == 'undefined') {
document.getElementById('popupBrowserAlert').style.display = 'block';
}
else {
popUp.focus();
}
You can simply use this:
This works if the value of
popUpisfalse,undefined,null,''or0.