当前位置: 移动技术网 > IT编程>开发语言>JavaScript > JS简单小应用之关于确认是否关闭框和页面跳转的写法

JS简单小应用之关于确认是否关闭框和页面跳转的写法

2019年01月17日  | 移动技术网IT编程  | 我要评论

关于确认是否关闭框和页面跳转的写法

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

确认关闭框:

这里写图片描述

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网