This article describes how to use JavaScript to check whether a pop-up window is blocked. whether the pop-up window is blocked or not. If you need it, you can refer to the pop-up window below. A pop-up window is required. Programmers who develop such websites have a difficult problem. They do not know whether these pop-up windows have been blocked by browsers or various browser plug-ins. Of course, the browser will notify the user, but these will rarely attract the user's attention. The following is a simple method 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 ('Remove the window blocking and click the link again. ');
}
Else {
PopUp. focus ();
}
The first step is to pop up the window normally and capture the window handle to check whether the handle object exists. If so, thank God. If it does not exist, we suggest you close the pop-up window blocking settings and click the link again. Of course, you can use more convincing information to prompt users. Or you can use a pop-up layer to display information.