关闭标签页时询问是否关闭

 

<!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>

 

posted @ 2016-06-02 23:04  zcynine  阅读(364)  评论(0)    收藏  举报