该方法在 关闭页面时 会提示
<script type="text/javascript"> var DispClose = true; function CloseEvent() { if (DispClose) { return "是否离开当前页面?"; } } window.onbeforeunload = CloseEvent; </script>