概述
- Window
- Document
- History
- location
- Screen
- Navigator
Location
- hash 设置或返回从井号 (#) 开始的 URL(锚)
- host 设置或返回主机名和当前 URL 的端口号
- hostname 设置或返回当前 URL 的主机名
- href 设置或返回完整的 URL
- pathname 设置或返回当前 URL 的路径部分
- port 设置或返回当前 URL 的端口号
- protocol 设置或返回当前 URL 的协议
- search 设置或返回从问号 (?) 开始的
URL(查询部分)
Window
全局常量: Infinity, NaN, undefined, null
全局方法: eval(), isFinite(), isNaN(), parseFloat(), parseInt(),decodeURI(),decodeURIComponent(), encodeURI(), encodeURIComponent()
- alert()
- confirm()
- prompt()
- setTimeout() 函数
- clearTimeout() 函数
- setInterval() 函数
- clearInterval() 函数
- focus() 函数:使窗体或空间获得焦点
- blur() 函数:使窗体或控件失去焦点
Location
- go(-1) 返回上一页
- .back() 后退
- .forward() 前进
Navigator
- appCodeName浏览器的代码名
- appName浏览器名
- ppVersion浏览器版本号
- userAgent**浏览器名和版本号**
- platform浏览器平台 Win32”, “Win16”, “WinCE”, “Mac68k”, “MacPPC”, “HP-UX”, “SunOS” 等
- cpuClass CPU的信息 “x86“
- online 浏览器是否处于联网状态
- cookieEnabled cookie是否可用
document
- parentNode 获取该节点的父节点
- childNodes 获取该节点的子节点数组
- firstChild 获取该节点的第一个子节点
- lastChild 获取该节点的最后一个子节点
- nextSibling 获取该节点的下一个兄弟元素
- previoursSibling 获取该节点的上一个兄弟元素
- firstElementChild 第一个子元素节点
- lastElementChild 最后一个子元素节点
- nextElementSibling 下一个兄弟元素节点
- previousElementSibling 前一个兄弟元素节点
- childElementCount 子元素节点个数量
jquery补充
- :eq(index) 在匹配的集合中选择索引值为index的元素
- :gt(index) 选择匹配集合中所有大于给定index的元素
- :lt(index) 选择匹配集合中所有索引值小于给定index参数元素
- :not(selector) 选择所有元素去除不匹配给定的选择器的元素
- :even 选择所引值为偶数的元素,从 0 开始计数。
- :odd 选择索引值为奇数元素,从 0 开始计数。
- :first 选择第一个匹配的元素
- :last 选择最后一个匹配的元素