关于确认是否关闭框和页面跳转的写法
<!DOCTYPE html>
<html lang="en">
<script>
window.alert('haha');
window.confirm('你确定要关闭吗?');
//确认是否关闭框
console.log(window.navigator.cookieEnabled); //true
window.location.href = 'https://www.baidu.com/'; //页面跳转
</script>
<head>
<meta charset="utf-8">
</head>
<body>
</body>
</html>
确认关闭框: