javascript - How to pop up a self-implemented pop-up window when closing the browser window?
世界只因有你
世界只因有你 2017-05-19 10:13:25
0
1
847

I checked a lot of information and found out that there is a onbeforeunload method, which is triggered when the tab is closed. If the return value is string (true/false will also be converted to string), the browser's default pop-up window will be called. Prompt the return value (but in fact, the new version of the browser has ignored the return value and directly uses the browser's default prompt statement)

But I think some companies can pop up a custom pop-up window when closing a tab, such as the promotional advertisement of Ve, I have seen it implemented.

Ve’s demonstration link, there is a demonstration at 1:30 seconds of closing the browser to pop up a custom pop-up window

I don’t know if you have encountered similar needs or have any good ideas. You can also mention them. Thank you everyone~

世界只因有你
世界只因有你

reply all(1)
PHPzhong

onbeforeunload Since it is a method, you can control the display of the custom pop-up window when this method is triggered

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template