This article mainly introduces the JavaScript to check whether pop-up windows are blocked method tips, this article is used to detect window.open pop-up window is blocked, the need for friends can refer to the
The exit box is useful and requires a pop-up window. For programmers who develop such a site, they have a tricky problem, and they don't know if the pop-ups are blocked by browsers or various browser plug-ins, not popping out. Of course, the browser notifies the user, but these rarely cause the user's attention. Here's an easy way to test whether your pop-up window is blocked.
The JavaScript
The code is as follows:
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 unblock the window and click the link again. ');
}
else {
Popup.focus ();
}
The first step is a normal pop-up window, and capture the window handle to check if the handle object exists. If there is, thank God. If it does not exist, we prompt the user to turn off the Pop-up Blocker settings and click on the link again. Of course, you can use more persuasive information to prompt the user. Or you can use a pop-up layer to display the information.