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: