zoukankan      html  css  js  c++  java
  • JavaScript——DOM操作

    windows对象操作

    <html>

    <body>

    <input type="button" value="点我" id="s1">

    </body>

    </html>

    <script type="text/javascript">

    var DianJi=document.getElementById("s1");

    DianJi.onclick=function()

    {

    window.open("http://www.baidu.com","_self");——自身窗口打开百度

    window.open("http://www.baidu.com","_blank");——新窗口打开百度,默认为新窗口打开

    window.close();——关闭当前窗口

    w.close();——关闭保存在变量w中的那个窗口

    window.openner.close();——关闭打开当前窗口的原窗口

    关闭多个子窗口,先将打开的窗口存入数组内,利用循环将其挨个关闭;

    window.scroll(x,y);——滚动页面至哪里,x代表横向,y代表纵向

    window.history.back();——页面后退;

    window.history.forward();——页面前进;

    window.history,go(n);——如果n是正数

    }

    </script>

  • 相关阅读:
    FastAdmin 提示框 toastr 改变文字
    FastAdmin 将会员模块升级为基础模块的升级指导
    随笔
    随笔
    c++11 lambda(了解)
    c++11 类型推断
    boost::archive::text_oarchive
    std::ostringstream
    随笔
    随笔1
  • 原文地址:https://www.cnblogs.com/weiyu11/p/6645838.html
Copyright © 2011-2022 走看看