• window对象


    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Window对象</title>

    </head>
    <body>
    <input type="button" id="openBtn" value="打开按钮">
    <input type="button" id="closeBtn" value="关闭按钮">

    <script>
    //与窗口弹出相关
    alert("this is test");
    var flag = confirm("你确定要退出吗?");
    if(flag){
    document.write("bye-bye"+"<br>");
    }else{
    document.write("noties"+"<br>");
    }
    var result = prompt("请输入用户名");
    document.write(result+"<br>")

    //与窗口打开关闭有关

    var openbtn= document.getElementById("openBtn");
    var newWindow;
    openbtn.onclick = function(){
    newWindow = open("https://www.baidu.com");
    }

    var closebtn = document.getElementById("closeBtn");
    closebtn.onclick=function () {
    newWindow.close();
    }

    //与定时器有关
    function fun() {
    document.write("bomb.....");
    }
    var id = setTimeout(fun,3000);
    clearTimeout(id);

    var interval = setInterval(fun,3000);
    clearInterval(interval);

    </script>
    </body>
    </html>
  • 相关阅读:
    drf框架 APView的请求生命周期
    web API接口、restful规范
    vue项目安装插件配置
    vue项目、路由
    day67
    vue组件
    day66
    HDFS(Hadoop Distribute File System)
    JVM运行优化学习笔记
    ELK(检索)
  • 原文地址:https://www.cnblogs.com/newcityboy/p/11403180.html
Copyright © 2020-2023  润新知