2017.11.27笔记

11.27笔记
1、window 对象
属性:ineerHeight ineerWidth 显示区域的宽高
outerWidth outerHight 浏览器的宽高
length 窗口下文档的个数,有几个显示几。
window.open() 打开文档
window.close() 关闭窗口
alert()弹框 confirm()选择对话框 prompt()输入对话框
resizeBy()在原来的基础上增加减少。
resizeTo()变成指定宽高。
eg:var myWindow = window.open('','','width=100,height=100')
myWindow.resizeBy(200,200) //变成宽300,高300。
scrollBy()按照指定像素值来滚动内容。
scrollTo()把内容滚动到指定坐标。
2、navigator对象
window.navigator.appCodeName 浏览器的代码名
window.navigator.appName 浏览器的名称
window.navigator.appVersion 浏览器的次级名称
window.navigator.lanuage 浏览器的语言
window.navigator.platform 浏览器的操作系统
3、document对象
window.document.cookie 获取或设置cookie
window.document.title 获取或设置title
window.document.URL 获取或设置URL
4、location对象
window.location.hash设置或返回从#号开始的URL
window.location.host主机名和当前URL的端口号
window.location.hostname主机名
window.location.href设置或返回当前完整的URL
window.location.pathname设置或返回当前URL的路径部分
window.location.replace() 替换 不会有历史记录
window.location.reload() 刷新
window.location.assign() 加载新的文档
5、screen对象
window.screen.height window.screen.width返回屏幕的宽高
window.screen.availHeight window.screen.availWidth 返回屏幕的宽高(除任
务栏之外)
6、body对象
window.document.body.clientWidth 网页可见区域的宽度
window.document.body.clientHight 网页可见区域的高度
window.document.body.scrollWidth 网页正文全文宽度
window.document.body.scrollHight 网页正文全文高度
window.document.body.scrollTop 网页被卷去的高度
window.document.body.scrollLeft 网页被卷去的左边宽度

原文地址:https://www.cnblogs.com/qifeidewo/p/7905484.html