[JavaScript: The Definitive Guide]笔记(1)

笔记(1):Window对象最常见的属性和函数

常用属性


closed

A boolean value that is true only if the window has been closed.

defaultStatus, status

The text that appears in the status line of the browser.

document

A reference to the Document object that represents the HTML document displayed in the window.

frames[]

An array of Window objects that represent the frames (if any) within the window.

history

A reference to the History object that represents the user's browsing history for the window.

location

A reference to the Location object that represents the URL of the document displayed in the window. Setting this property causes the browser to load a new document.

name

The name of the window. Can be used with the target attribute of the HTML <a> tag, for example.

opener

A reference to the Window object that opened this one, or null if this window was opened by the user.

parent

If the current window is a frame, a reference to the frame of the window that contains it.

self

A self-referential property; a reference to the current Window object. A synonym for window.

top

If the current window is a frame, a reference to the Window object of the top-level window that contains the frame. Note that top is different from parent for frames nested within other frames.

window

A self-referential property; a reference to the current Window object. A synonym for self.

常用方法


alert( ) , confirm( ), prompt( )

Display simple dialog boxes to the user and, for confirm( ) and prompt( ), get the user's response.

close( )

Close the window.

focus( ) , blur( )

Request or relinquish keyboard focus for the window. The focus( ) method also ensures that the window is visible by bringing it to the front of the stacking order.

moveBy( ) , moveTo( )

Move the window.

open( )

Open a new top-level window to display a specified URL with a specified set of features.

print( )

Print the window or frame -- same as if the user had selected the Print button from the window's toolbar (Netscape 4 and later and IE 5 and later only).

resizeBy( ) , resizeTo( )

Resize the window.

scrollBy( ) , scrollTo( )

Scroll the document displayed within the window.

setInterval( ) , clearInterval( )

Schedule or cancel a function to be repeatedly invoked with a specified delay between invocations.

setTimeout( ) , clearTimeout( )

Schedule or cancel a function to be invoked once after a specified number of milliseconds.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值