window的子对象

2023-06-13,


在控制台输入


history
history.length 历史记录个数
history.back() 后退
history.forward() 前进
history.go(n) 跳到某一页,可正可负,当n是o时刷新页面

location
window.location;
location.href:可更改地址
location.search:查询数据
location.hash:返回锚点
location.reload(true/false):重新刷新页面,true不走缓存,false走缓存。默认不走缓存
location.assign()括号内为空,刷新页面

navigator

Navigator 对象包含有关浏览器的信息。

appName 返回浏览器的名称。

appCodeName 返回浏览器的代码名称的字符串。

cookieEnabled 指明浏览器中是否启用 cookie 的布尔值。

platform 返回运行浏览器的操作系统平台。

appVersion 返回浏览器的平台和版本信息。

userAgent-- 用户代理头的字符串表示

  Screen 

Screen 对象包含有关客户端显示屏幕的信息。

height 返回显示屏幕的高度。 width 返回显示器屏幕的宽度。

availHeight 显示屏幕的可用高度 (除 Windows 任务栏之外)。

availWidth 显示屏幕的可用宽度 (除 Windows 任务栏之外)。



window的子对象的相关教程结束。

《window的子对象.doc》

下载本文的Word格式文档,以方便收藏与打印。