开发者

How to check whetherpop up blocker is turned ON or not in a browser using Code ?

How to check whether pop up blocker is turned ON or not in a browser using java or Java script Code ?

function check ()
{
    document.login.action= url+"test.jsp";
    document.login.s开发者_JAVA百科ubmit();
}   

I will call this function on click of submit button


How about:

var myWindow = window.open (url);

if (if (myWindow == null || typeof(myWindow )=='undefined'))
{
     // popup blocker is enabled
}
else
{
     myWindow.close();
}


If you use window.open() to open the popup, check for the return value. According to the MDC doc center (a good javascript reference) the return value is null if opening the window didn't succeed for whatever reason.

var windowReference = window.open(url);

See the documentation on window.open here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜