zoukankan      html  css  js  c++  java
  • BOM的history对象

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>history对象</title>
    </head>
    <body>
    <input type="button" value="front" onclick="f1()">
    <a href="history_obj1.html">555</a>
    <script>
    //history内部有三个方法:forward,back,go 一个属性 length
    function f1() {
    // history.forward();
    history.go(1);//history.go(0)代表当前页面
    }


    </script>

    </body>
    </html>
    ======================================================================
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Title</title>
    </head>
    <body>
    <input type="button" value="back" onclick="f2()">
    <script>
    function f2() {
    // history.back();
    history.go(-1);
    alert(history.length);// 2 返回历史URL个数

    }


    </script>

    </body>
    </html>
  • 相关阅读:
    [转] linux 信号量之SIGNAL
    [转] 查看CPU使用率 top命令详解
    shell 脚本编程
    ToggleButton
    MultiAutoCompleteTextView
    AutoCompleteTextView
    IO流总结
    JavaWeb 案例——访问权限控制
    IO流之字符流
    File类
  • 原文地址:https://www.cnblogs.com/startl/p/12244267.html
Copyright © 2011-2022 走看看