• js5——页面转换


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

    </head>
    <body>
    <input type="button" id="btn" value="刷新">
    <input type="button" id="goItcast" value="去传智">
    <script>
    //reload方法,定义一个按钮 刷新当前的页面
    // var h1=window.history;
    // var h2=history;
    // alert(h1);
    // alert(h2);
    // setInterval(fun,3000);
    // function fun() {
    // alert("name")
    // }
    var btn=document.getElementById(btn);
    btn.onclick=function () {
    location.reload();

    }

    // alert(href);
    //点击按钮去访问www.itcast.cn官网
    var goItcast=document.getElementById("goItcast");
    goItcast.onclick=function () {
    location.href="https://www.baidu.com";
    }
    var href=location.href;
    </script>
    </body>
    </html>

  • 相关阅读:
    优秀数
    加法检测器
    数字转换
    选课
    二叉苹果树
    分离与合体
    括号配对
    凸多边形的划分
    能量项链
    石子合并
  • 原文地址:https://www.cnblogs.com/soyadios/p/11963455.html
Copyright © 2020-2023  润新知