Posted in Javascript onMarch 05, 2014
<!DOCTYPE html> <html> <head> <script> function closeIt() { return "Any string value here forces a dialog box to \n" + "appear before closing the window."; } window.onbeforeunload = closeIt; </script> </head> <body> <a href="https://3water.com">Click here to navigate to 3water.com</a> </body> </html>
兼容FF,IE,Chrome的js离开或刷新页面检测,关键的部分是要有return
js离开或刷新页面检测(且兼容FF,IE,Chrome)
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@