Browser对象
Window对象
即浏览器中打开的窗口,当文档里面有框架(frame或者iframe标签)时,浏览器会为HTML文档创建一个window对象,并为每个框架创建一个额外的window对象。
属性
closed //返回窗口是否已被关闭
defaultStatus //设置或返回窗口状态栏中的默认文本
document //对Document对象的只读引用
history //对History对象的只读引用
innerheight //返回窗口的文档县市区的宽度,IE中的表示方法不同。
innerwidth //返回窗口的文档显示区的宽度
location //用于窗口或框架的Location对象
name //设置或返回窗口的名称
Navigator //对Navigator对象的只读引用
opener //返回对创建此窗口的窗口的引用,只有表示顶层窗口的window对象的opener属性才有效,表示框架的Window对象的opener属性无效
outerheight //返回窗口的外部高度
outwidth //返回窗口的外部宽度
Screen //对Screen对象的只读引用
status //设置窗口状态栏的文本
top //返回最顶层的先辈窗口
方法
alert() //显示带有一段消息和一个确认按钮的警告框
blur() //把键盘焦点从底层窗口移开
clearInterval() //取消由setInterval()设置的timeout,参数是setInterval()返回的ID值。
clearTimeout() //取消由setTimeout()方法设置的timeout
close() //关闭浏览器窗口,只有通过JavaScript代码打开的窗口才能够由JavaScript代码关闭。
confirm() //显示带有一段消息以及确认按钮和取消按钮的对话框
createPopup() //创建一个pop-up窗口
focus() //把键盘焦点给予一个窗口
moveBy() //可相对窗口的当前坐标把它移动制定的像素
moveTo() //把窗口的左上角移动到一个指定的坐标
open() //打开一个新的浏览器窗口或查找一个已命名的窗口
print() //打印当前窗口的内容
prompt() //显示可提示用户输入的对话框
resizeBy() //按照制定的像素调整窗口的大小
resizeTo() //把窗口的大小调整到指定的宽度和高度
scrollBy() //按照指定的像素值来滚动内容
scrollTo() //把内容滚动到指定的目标
setInterval() //按照指定周期来调用函数或计算表达式
setTimeout() //在指定的毫秒数后调用函数或表达式
Navigator对象
包含有关浏览器的信息
集合:plugins[] //Plugin对象数组,其中元素代表浏览器已经安装的插件。
属性
appCodeName //返回浏览器的代码名,navigator.appCodeName
[查看有关浏览器信息:
<html>
<body>
<script type="text/javascript">
document.write("<p>浏览器:")
document.write(navigator.appName + "</p>")
document.write("<p>浏览器版本:")
document.write(navigator.appVersion + "</p>")
document.write("<p>代码:")
document.write(navigator.appCodeName + "</p>")
document.write("<p>平台:")
document.write(navigator.platform + "</p>")
document.write("<p>Cookies 启用:")
document.write(navigator.cookieEnabled + "</p>")
document.write("<p>浏览器的用户代理报头:")
document.write(navigator.userAgent + "</p>")
</script>
</body>
</html>]
appMinorVersion //返回浏览器的次级版本
appName //浏览器的名称
appVersion //浏览器的平台和版本信息
browserLanguage //当前浏览器的语言
cookieEnabled //知名浏览器中是否启用cookie的布尔值
cpuClass //浏览器的CPU等级
onLine //指明系统是否处于脱机模式的布尔值
platform //运行浏览器的操作系统凭条
systemLanguage //返回OS使用的默认语言
userAgent //返回由客户机发送服务器的user-agent头部的值
userLanguage //返回OS的自然语言设置
方法
javaEnabled() //规定浏览器是否启用JAVA
taintEnabled() //规定浏览器是否启用数据污点(data tainting)
Screen对象
包含有关客户端显示屏幕的信息
属性
调用有关用户屏幕信息:
<script type="text/javascript">
document.write("Screen resolution: ")
document.write(screen.width + "*" + screen.height)
document.write("<br />")
document.write("Available view area: ")
document.write(screen.availWidth + "*" + screen.availHeight)
document.write("<br />")
document.write("Color depth: ")
document.write(screen.colorDepth)
document.write("<br />")
document.write("Buffer depth: ")
document.write(screen.bufferDepth)
document.write("<br />")
document.write("DeviceXDPI: ")
document.write(screen.deviceXDPI)
document.write("<br />")
document.write("DeviceYDPI: ")
document.write(screen.deviceYDPI)
document.write("<br />")
document.write("LogicalXDPI: ")
document.write(screen.logicalXDPI)
document.write("<br />")
document.write("LogicalYDPI: ")
document.write(screen.logicalYDPI)
document.write("<br />")
document.write("FontSmoothingEnabled: ")
document.write(screen.fontSmoothingEnabled)
document.write("<br />")
document.write("PixelDepth: ")
document.write(screen.pixelDepth)
document.write("<br />")
document.write("UpdateInterval: ")
document.write(screen.updateInterval)
document.write("<br />")
</script>
availHeight //返回显示屏幕的高度(除Windows任务栏之外)
availWidth //返回显示屏幕的宽度(除Windows任务栏之外)
bufferDepth //设置或返回调色板的比特深度
colorDepth //返回目标设备或缓冲器上的调色板的比特深度
deviceXDPI //返回显示屏幕的每英寸水平点数
deviceYDPI //返回显示屏幕的每英寸垂直点数
fontSmoothingEnabled //返回用户是否在显示控制面板中启用了字体平滑
height //返回显示屏幕的高度
logicalXDPI //返回显示屏幕每英寸的水平方向的常规点数
logicalYDPI //返回显示屏幕每英寸的垂直方向的常规点数
pixelDepth //返回显示屏幕的颜色分辨率(比特每像素)
updateInterval //设置或返回屏幕的刷新率
width //返回显示器屏幕的宽度
History 对象
包含用户(在浏览器窗口中)访问过的URL。
属性
length //返回浏览器历史列表中的url数量
方法
back() //加载history列表中的前一个URL
forward() //加载history列表中的下一个URL
go() //加载历史列表中的某个具体的页面
Location对象
包含有关当前URL的信息。
属性
hash //设置或返回从井号(#)开始的URL(锚)
host //设置或返回主机名和当前URL的端口号
hostname //设置或返回当前URL的主机名
href //设置或返回完整的URL
pathname //设置或返回当前URL的路径部分
port //设置或返回当前URL的端口号
protocol //设置或返回当前URL的协议
search //设置或返回从问好(?)开始的URL(查询部分)
方法
assign() //加载新的文档
reload() //重新加载当前文档
replace() //用新的文档替换当前文档
Browser对象的更多相关文章
- HTML BOM Browser对象
BOM:Browser Object Model,即浏览器对象模型,提供了独立于内容的.可以与浏览器窗口进行互动的对象结构. Browser对象:指BOM提供的多个对象,包括:Window.Navig ...
- JavaScript对象 + Browser 对象 + HTML DOM 对象
JavaScript 对象 Array Boolean Date Math Number String RegExp Global Browser 对象 Window Navigator Screen ...
- Browser 对象
Browser 对象 window对象表示浏览器中打开的窗口如果文档包含框架(iframe 或 iframe标签),浏览器会为HTML文档创建一个window对象,并为每个框架创建一个额外的windo ...
- HTML:Browser 对象
ylbtech-HTML:Browser 对象 1.返回顶部 1. Window 对象 Window 对象表示浏览器中打开的窗口. 如果文档包含框架(frame 或 iframe 标签),浏览器会为 ...
- JavaScript:Browser 对象
ylbtech-JavaScript:Browser 对象 1. Window 对象返回顶部 1. Window 对象 Window 对象 Window 对象表示浏览器中打开的窗口. 如果文档包含框 ...
- 解决jquery1.9不支持browser对象的问题||TypeError: $.browser is undefined
在插件的源代码里插入如下代码: (function(jQuery){ if(jQuery.browser) return; jQuery.browser = {}; jQuery.browser.mo ...
- JavaScript Browser 对象 实例
使用JavaScript来访问和控制浏览器对象实例. Window 对象 弹出一个警告框 弹出一个带折行的警告框 弹出一个确认框,并提醒访客点击的内容 弹出一个提示框 点击一个按钮时,打开一个新窗口 ...
- Browser对象之Window对象
对象属性 对象方法 setInterval() 按照指定的周期(以毫秒计)来调用函数或计算表达式. setInterval() 方法可按照指定的周期(以毫秒计)来调用函数或计算表达式. setInte ...
- JS 的 Browser对象
Window对象 closed innerHeight 窗口文档显示区的高度,包括滚动条 outerHeight 窗口总高度,包括工具条和滚动条 open() close() alert( ...
随机推荐
- RMAN-06059: expected archived log not found, loss of archived log compromises recoverability
归档日志被物理删除后执行rman操作报错: RMAN> backup database plus archivelog; Starting backup at -JUL- :: current ...
- ajax异步提交文件
首先 下载jquery和jquery.form.js http://malsup.com/jquery/form/ <script type="text/javascript&qu ...
- eclipse lua使用
首先安装lua eclipse,装插件或者独立版的都可以.但是在独立版的eclipse装subclipse会报错,Failed to prepare partial IU.解决办法: work aro ...
- Excel操作增强包
一.前期准备1) pywin32安装包(根据系统要求选择32位装包还是64位安装包)2) xlwings安装包二.安装过程1) pywin32安装包为exe文件,直接进行安装即可2) xlwi ...
- Linux: .vimrc
set nuset autoindentset cindent"set tabstop=2"set shiftwidth=2set cursorlineset hlsearch&q ...
- datagridview 用法
标签:c# datagridview 用法 拖一个datagridview控件 初始的名字叫dataGridView1 准备工作: 点击控件右上角的三角,选择“添加列”添加表头的项 基本操作: ...
- js break continue
for 循环从 1 到 10 迭代变量 i.在循环主体中,if 语句将(使用取模运算符)检查 i 的值是否能被 5 整除.如果能被 5 整除,将执行 break 语句.alert 显示 "4 ...
- struct2 学习总结
花了近半个月学习了struct2.现大致总结下学习点: 1. struct2 入门以及基本配置(未继承ActionSupport,配置struts.xml文件,execute方法直接返回SUCESS) ...
- tomcat支持的websocket服务
首发:个人博客 在tomcat7之后的版本,写个websocket服务程序非常容易——如以下代码所示,当客户端建立了一个连接并发送了一些什么内容到服务器,服务器将每隔两秒返回一个字符串“world”. ...
- Intent跳转传list集合
先把List<>改为ArrayList<> ArrayList<Good> list=new ArrayList<Good>(); Intent int ...