zoukankan      html  css  js  c++  java
  • 7月15日学习之BOM

    setTimeout()  //延时器,只执行一次代码

    clearTimeout()  //清除演示器

    setIntervla()  //定时器,根据指定时间间隔执行一次代码

    clearInterval()  //清除定时器

    window.history.length  //访问的历史页面的数目

    window.history.forward()  //前一页

    window.history.back();  //后一页

    window.history.go(-1);  //跳转至曾经访问过的某个页面,负值表示向后跳

    document.referrer//需要将两个文件放在服务器中才能得到想要的结果,若直接在本地文件夹中则得到空字符串,若直接在浏览器地址栏中输入b.html的URL地址或使用打开菜单访问b.html,则document.referrer的值为空字符串。  

    window.moveBy   //by是相对的意思(从原先的位置而言)

    window.moveTo  //to是绝对的意思(从整体而言)

    window.moveTo  //把窗口大小调整为指定的宽度和高度。

    window.resizeBy  //把窗口大小增加或减小指定的宽度和高度

    window.screenLeft/window.screenX  //与屏幕左侧的距离

    window.screenTop/window.screenY  //与屏幕顶部的距离

    注:

    浏览器窗口位置:
    IE、Chrome、Safari、Opera 都提供了支持 window.screenLeft 和 window.screenTop,但是Firxfox不支持这个两个属性;
    Firxfox、Chrome、Safari、Opera 都提供了支持 window.screenX 和 window.screenY,但是 IE 不支持这个两个属性;
    document.body.offsetHeight/document.body.clientHeight  //内容高度(body的高度)
    window.innerHeight    //Chorm下使用
    document.documentElement.clientHeught  //浏览器的可视高度
    document.documentElement.scrollHeight  //内容的高度(HTML的高度)
    document.documentElement.scrollTop  //滚动条滚动的高度

    window.open  //打开一个新窗口
    window.close  //关闭窗口
    window.defaultStatus/window.Status  //状态栏信息
    注:window.status  获取的是脚本赋予的临时值。window.defaultStatus   获取的是默认值。
     
    document.lastModified  //返回文档最后修改时间
    document.referrer    //退回浏览器历史中的上一个位置的URL
    document.title    //返回当前页面内title标签内显示的文本
    document.URL    //返回当前页面的URL
    document.anchors[0].innerHTML  //页面内第一个锚点的内容
    location.reload(false)    //该方法强迫浏览器刷新当前页面
    navigator.appCodeName    //申明浏览器的代码名
    navigator.appVirson    //返回浏览器的平台和版本信息。该属性是一个只读的字符串
    eval    //可以处理一段由字符串表示的JS代码
    encodeURI    //编码
    decodeURI    //解码
  • 相关阅读:
    SQLite 基本使用
    SQLite 语法
    html5晋级之路-css介绍
    html5晋级之路-web storage
    html5晋级之路-元素语法
    html晋级之路-背景、实体
    ios-晋级之路 CocoaPods的使用
    如何在Mac OS X上安装 Ruby运行环境
    html5晋级之路-学习笔记表单
    html5晋级之路-学习笔记
  • 原文地址:https://www.cnblogs.com/Changero/p/4649851.html
Copyright © 2011-2022 走看看