<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> <title></title> </head> <body> <script type="text/javascript"> window.onbeforeunload = function(e){ e.returnValue = ‘确定离开当前页面吗?‘; } </script> </body> </html>
原文:http://www.cnblogs.com/zcynine/p/5554730.html