zoukankan      html  css  js  c++  java
  • js_浏览器对象

    1. 浏览器对象

    window

    • window对象不但充当全局作用域,而且表示浏览器窗口
      • 所有全局js对象,函数和变量自动成为window对象的成员
      • 全局变量时window对象的属性
      • 全局函数是window对象的方法  
    • innerWidth : 浏览器内部宽度。 innerHeight :浏览器内部高度
    • outerWidth / outerHeight  整个浏览器的宽高

    navigator

    • 表示浏览器信息
    • navigator.appName :  浏览器名称
    • navigator。appVersion : 浏览器版本
    • navigator.language : 浏览器设置的语言
    • navigator.platform : 操作系统的类型
    • navigator.userAgent : ua

    screen

    • screen.width : 屏幕宽度
    • screen.height : 屏幕高度
    • screen.colorDepth : 返回颜色位数

    location : 当前页面的url信息 

    • location.href
    • location.protocol
    • location.host
    • location.port
    • location.pathname
    • location.search
    • location.hash

    document

    • 表示当前页面,是整个dom的根结点
    • document.title  
    • document.getElementById()
    • document.getElementTagName()  
    • document.cookie  ; 'v=123; remember=true; prefer=zh'

    history

    • history.back()  后退
    • history.forward()  前进
    •           
  • 相关阅读:
    codevs 1432 总数统计
    codevs3500 快速幂入门题解
    #163. 【清华集训2015】新式计算机
    2989:糖果
    191:钉子和小球
    java 删除所有HTML工具类
    DateTools时间插件
    新的开始
    springBoot---端口,路径数据配置
    springBoot---多个配置文件读取
  • 原文地址:https://www.cnblogs.com/zhangjian0092/p/11792030.html
Copyright © 2011-2022 走看看