惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - qy

枚举 Duwamish7资料收集- [] 学习Duwamish7的MSDN说明及相关技术策略 Duwamish7学习笔记(七) Duwamish7学习笔记(六) Duwamish7学习笔记(五) Duwamish7学习笔记(四) Duwamish7学习笔记(三) Duwamish7学习笔记(二) Duwamish7学习笔记(-) jQuery介绍及语法----转载 浅谈.net事件机制 使用EditPlus2编写C#代码 跟踪用户会话 按钮确认(js与C#交互) 3-28学会的几句sql语句 Visual Studio 2003/Visual Studio 2005常用快捷键 ----转 最优化javascript自定义对象 关于用div实现table的效果
BOM
qy · 2007-03-20 · via 博客园 - qy

   js是一种面向对象的语言,它把一切都看成对象,BOM就是浏览器对象模型。

   1.window对象,window对象表示整个浏览器窗口。
      frames集合--可以用window.frames[0]或者window["frameName"]来引用
         也可用top.frames[0]或者top.frames["frameName"]来引用(top对象表示最顶成的对象及window对象)
      a.窗口操作
         moveBy(dx,dy)--把浏览器移动dx,dy个像素
         moveTo(x,y)    --把浏览器的左上角移动到x,y像素的位置
         resizeBy(dw,dh)--缩小或放大浏览器的窗口
         resizeTo(x,y)    --把调整浏览器窗口的大小为x,y(不能为负数)
      b.打开新窗口
         window.open("http://qiuyun.cnblogs.com","frameName",x,y)
         第一个参数为打开的连接
         第二个参数为在那个框架打开,可以用系统的_seft,_blank等,也可用自定的框架名,如果不填会打开新窗口
         第三个参数x为为一个用,隔开的字符串:
            left和top为窗口左上角的坐标;height和width为窗口的大小;resizable判断窗口是否能拖动边线而调整大小默认为no;scrollable表示是否出现滚动条,默认为no;toolbar表示是否出现工具条,默认为no;status表示是否出现状态栏,默认为no;location表示是否现实web地址栏,默认为no。
         第四个参数为一个bool值,表示是否用新载入的页面替换当前载入的页面,一般很少用这个参数。
         例:var test = window.open("http://qiuyun.cnblogs.com","_blank","height=100,width=100,top=0,left=0");
                  test.close();  //关闭窗口,在窗口可将其关闭
                  window.close();//在test窗口的代码里可将其关闭
        c.系统对话框
            alert(msg); //警告框
            confirm("OK?") //选者框,将返回一个bool值
            prompt(msg1,msg2); //可让用户输入信息,第二个参数为默认值。
            这些窗口都是模式化的窗口,也就是在没关闭这些窗口的时候无法对浏览器做操作。
        d.状态栏
            status和defaultStatus属性
            status可以让状态栏的文字暂时改变,defaultStatus可以在用户离开当前页面前一直改变。
        e.时间间隔和暂停
            var test  = setInterval("alert('GO')",10000)  //每隔10秒就谈出对话框GO
            clearInterval(test);      //终止它
            var test1 = setTimeout("alert('GO')",10000); //将在10秒后探出对话框GO
            clearTimeout(test1);                     //可将它取消
        f.历史
            window.history.go(-1); //后退一格
            history.back();  //back按钮
            history.forward();//forward按钮
            可用history.length察看历史中的页面数
   
   2.document对象,其实他是window对象的属性
        a.通用属性
            alinkColor  //激活的链接的颜色
            bgColor      //背景颜色
            fgColor      //文本颜色
            lastModified //最后修改页面的日期
            linkColor   //连接的颜色
            referrer      //浏览器后退一个位置的url
            title            //<title/>中的文本
            URL          //当前页面的url
            vlinkColor   //访问过的链接的颜色
        b.集合
            anchors   //所有<a name=.. ..的集合
            applets    //所有applet的集合
            embeds   //所有嵌入式对象的集合
            forms      //所有表单的集合
            images     //所有图片的集合
            links        //所有连接的集合< a href=...
        c.document.write()和document.writeln()方法
   3.location对象,他是window和document对象的属性
        a.属性
            hash  //该方法返回#号后的内容(包括#)
            host  //返回服务器的名字,如www.qq.com
            hostName  //等于qq.com
            href  //当前浏览器的完整url
            pathname      //url主机名后的部分,如www.qq.com/news/index.aspx  将放回/news/index.aspx
            port            //端口
            protocol      //url中使用的协议,http://或者ftp://
            search         //将返回?后(包括?)的内容
         b.reload()方法
            刷新当前页面,加入true参数将从服务器段重载
    4.navigator对象和screen对象
            不常用