The exit is very useful and requires a pop-up window. For programmers who develop such websites, they have a difficult problem. They don’t know whether these pop-ups are blocked by browsers or various browser plug-ins and do not pop up. Of course, the browser will notify the user, but these rarely attract the user's attention. Here is a simple way to test whether your popup is blocked.
The JavaScript
The code copy 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 on the link again.');
}
else {
popUp.focus();
}
The first step is to normal pop-up window and capture the window handle to check whether this handle object exists. If it exists, thank God. If it does not exist, we prompt the user to close the pop-up blocking settings and click on the link again. Of course, you can prompt the user with more convincing information. Or you can use a pop-up layer to display the information.