zoukankan      html  css  js  c++  java
  • JS_外部对象_window

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>location地址栏</title>
    <script type="text/javascript">
    //location 地址栏对象
    function f1() {
    var b=confirm("你确定离开本页面么???")

    if(b){
    //跳转
    location.href="http://www.baidu.com";
    }
    }
    function f2() {
    //刷新
    location.reload();
    }
    //screen 屏幕对象
    function f3() {
    console.log(screen.width);
    console.log(screen.height);
    console.log(screen.availWidth);
    console.log(screen.availHeight);
    }
    //history 历史对象
    function f4() {
    history.forward()
    }
    //navigator对象
    function f5() {
    console.log(navigator.userAgent);
    }
    </script>
    </head>
    <body>
    <input type="button" value="百度"
    onclick="f1();">
    <input type="button" value="刷新"
    onclick="f2();">
    <input type="button" value="屏幕"
    onclick="f3();">
    <input type="button" value="前进"
    onclick="f4();">
    <input type="button" value="帮助"
    onclick="f5();">

    </body>
    </html>

  • 相关阅读:
    LeetCode90.子集 ||
    Ubuntu下的Matlab安装
    FAQ
    青石板
    交叉熵损失函数
    tf常用函数
    激活函数
    SGD和GD的区别
    卷积神经网络
    Ubuntu安装Matlab2016b
  • 原文地址:https://www.cnblogs.com/Bighua123/p/7634368.html
Copyright © 2011-2022 走看看