browers and html dom 官方解读

Window Object

The window object represents an open window in a browser.

If a document contain frames (<frame> or <iframe> tags), the browser creates one window object for the HTML document, and one additional window object for each frame.

Note: There is no public standard that applies to the Window object, but all major browsers support it.

注解:窗口对象指的是一个在浏览器中打开的窗口。

TIPs : 如果一个html文档包含frames或iframe标签,则浏览器创建一个代表html文档的窗口对象,为每个frame创建一个额外的窗口对象

Window Object Properties

窗口对象的一些常用属性,不一一列举,可见w3school官网: window dom

document       Returns the Document object for the window ( See Document object )
窗口对象的文档对象

frames Returns an array of all the frames (including iframes) in the current window
返回当前窗口的所有frames框架,是一个数据所装,可以用parant.window.frames['frame_name']获取

lenth Returns the number of frames (including iframes) in a window
不解释

location Returns the Location object for the window (See Location object)


parent Returns the parent window of the current window
返回当前窗口的父窗口

Window Object Methods

常用方法
alert(),confirm(),从close()什么的就不说了
重点说一下:
open() :
window.open( URL,name,specs,replace )
打开一个空白窗口
var myWindow = window.open("","","width=200,height=100");

Open a new window called "MsgWindow", and write some text into it:

var myWindow = window.open("","MsgWindow","width=200,height=100");
myWindow.document.write("<p>This is 'MsgWindow'. I am 200px wide and 100px tall!</p>");
再打开的窗口写入内容













  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值