How to make a corresponding action before the user turns off the web browser window

xiaoxiao2021-03-30  210

Refer to Maison 'Blog for a long time, doing a web project, always headache. The user does not cancel or exit the function, directly shut down the browser. Or when the user is in progress, the error has a link, jumps to other pages, . input data loss caused by today found onbeforeunload event, it is so used: