常用浏览器对象:
1. window 不但充当全局作用域,而且表示浏览器窗口
2. navigator 表示浏览器的信息, 最常用的属性包括appName, appVersionm, language, platform, userAgent
3. screen 表示屏幕的信息
4. location 表示当前页面的URL信息
http://www.example.com:8080/path/index.html?a=1&b=2#TOP
location.protocol; // 'http'
location.host; // 'www.example.com'
location.port; // '8080'
location.pathname; // '/path/index.html'
location.search; // '?a=1&b=2'
location.hash; // 'TOP'
5. document 表示当前页面。由于HTML在浏览器中以DOM形式表示为树形结构,document
对象就是整个DOM树的根节点。6. history 慎用