you are here: codestackercodes [RSS] → tag popup [RSS]

detecting popup blockers

var win = window.open(...);
if(win == null || typeof(win) == "undefined" || (win == null && win.outerWidth == 0) || (win != null && win.outerHeight == 0) || win.test == "undefined") {
// popup blocked :(

}

unobstrusive popup

http://www.quirksmode.org/js/popup.html

   function popup(url) {
        newWindow = window.open(url, 'name', 'height=400,width=335,scrollbars=yes');
        if (window.focus) { newWindow.focus() }
            return false;
    }

// <a href="link.html" onclick="popup('link.html');">Link</a>
Displaying all 2 Code