window

  • 版本网址缩略名: DOM/window
  • 版本标题: window
  • 版本 id: 174558
  • 创建于:
  • 创建者: JarodWang
  • 是否是当前版本?
  • 评论

修订内容

{{template.DomRef()}} This section provides a brief reference for all of the methods, properties, and events available through the DOM window object. The window object implements the Window interface, which in turn inherits from the AbstractView interface.

The window object represents the window itself. The document property of a window points to the DOM document loaded in that window. A window for a given document can be obtained using the {{template.Domxref("document.defaultView")}} property.

In a tabbed browser, such as Firefox, each tab contains its own window object (and if you're writing an extension, the browser window itself is a separate window too - see Working with windows in chrome code for more information). That is, the window object is not shared between tabs in the same window. Some methods, namely {{template.Domxref("window.resizeTo")}} and {{template.Domxref("window.resizeBy")}} apply to the whole window and not to the specific tab the window object belongs to. Generally, anything that can't reasonably pertain to a tab pertains to the window instead.

Properties

window.Components
The entry point to many XPCOM features. Some properties, e.g. classes, are only available to sufficiently privileged code.
window.content and window._content
Returns a reference to the content element in the current window. The variant with underscore is deprecated.
window.closed
This property indicates whether the current window is closed or not.
window.controllers
Returns the XUL controller objects for the current chrome window.
window.crypto
Returns the browser crypto object.
window.defaultStatus
Gets/sets the status bar text for the given window.
window.directories
Returns a reference to the directories toolbar in the current chrome.
window.document
Returns a reference to the document that the window contains.
window.frameElement
Returns the element in which the window is embedded, or null if the window is not embedded.
window.frames
Returns an array of the subframes in the current window.
window.globalStorage
Multiple storage objects that are used for storing data across multiple pages.
window.history
Returns a reference to the history object.
window.innerHeight
Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
window.innerWidth
Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
window.length
Returns the number of frames in the window.
window.location
Gets/sets the location, or current URL, of the window object.
window.locationbar
Returns the locationbar object, whose visibility can be toggled in the window.
window.menubar
Returns the menubar object, whose visibility can be toggled in the window.
window.name
Gets/sets the name of the window.
window.navigator
Returns a reference to the navigator object.
window.opener
Returns a reference to the window that opened this current window.
window.outerHeight
Gets the height of the outside of the browser window.
window.outerWidth
Gets the width of the outside of the browser window.
window.pageXOffset
Gets the amount of content that has been hidden by scrolling to the right.
window.pageYOffset
Gets the amount of content that has been hidden by scrolling down.
window.parent
Returns a reference to the parent of the current window or subframe.
window.personalbar
Returns the personalbar object, whose visibility can be toggled in the window.
window.pkcs11
Returns the pkcs11 object, which can be used to install drivers and other software associated with the pkcs11 protocol.
window.screen
Returns a reference to the screen object associated with the window.

The following is duplicated on DOM:window.screen

window.screen.availTop
Specifies the y-coordinate of the first pixel that is not allocated to permanent or semipermanent user interface features.
window.screen.availLeft
Returns the first available pixel available from the left side of the screen.
window.screen.availHeight
Specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows.
window.screen.availWidth
Returns the amount of horizontal space in pixels available to the window.
window.screen.colorDepth
Returns the color depth of the screen.
window.screen.height
Returns the height of the screen in pixels.
window.screen.left
Gets/sets the current distance in pixels from the left side of the screen.
window.screen.pixelDepth
Gets the bit depth of the screen.
window.screen.top
Gets/sets the distance from the top of the screen.
window.screen.width
Returns the width of the screen.

end of duplicated content

window.screenX
Returns the horizontal distance of the left border of the user's browser from the left side of the screen.
window.screenY
Returns the vertical distance of the top border of the user's browser from the top side of the screen.
window.scrollbars
Returns the scrollbars object, whose visibility can be toggled in the window.
window.scrollMaxX
The maximum offset that the window can be scrolled to horizontally.
(i.e., the document width minus the viewport width)
window.scrollMaxY
The maximum offset that the window can be scrolled to vertically.
(i.e., the document height minus the viewport height)
window.scrollX
Returns the number of pixels that the document has already been scrolled horizontally.
window.scrollY
Returns the number of pixels that the document has already been scrolled vertically.
window.self
Returns an object reference to the window object itself.
window.sessionStorage
A storage object for storing data within a single page session.
window.sidebar
Returns a reference to the window object of the sidebar.
window.status
Gets/sets the text in the statusbar at the bottom of the browser.
window.statusbar
Returns the statusbar object, whose visibility can be toggled in the window.
window.toolbar
Returns the toolbar object, whose visibility can be toggled in the window.
window.top
Returns a reference to the topmost window in the window hierarchy.
window.window
Returns a reference to the current window.

Methods

window.alert
Displays an alert dialog.

base64 func https://bugzilla.mozilla.org/show_bug.cgi?id=287112 (see last comments) https://bugzilla.mozilla.org/show_bug.cgi?id=123003 http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsGlobalWindow.cpp#4946

window.atob
Decodes a string of data which has been encoded using base-64 encoding.
window.back
Moves back one in the window history.
window.blur
Sets focus away from the window.
window.btoa
Creates a base-64 encoded ASCII string from a string of binary data.
window.captureEvents {{template.Obsolete_inline()}}
Registers the window to capture all events of the specified type.
window.clearInterval
Cancels the repeated execution set using setInterval.
window.clearTimeout
Clears a delay that's been set for a specific function.
window.close
Closes the current window.
window.confirm
Displays a dialog with a message that the user needs to respond to.
window.dump
Writes a message to the console.
window.escape
Encodes a string.
window.find
Searches for a given string in a window.
window.focus
Sets focus on the current window.
window.forward
Moves the window one document forward in the history.
window.getAttention
Flashes the application icon.
window.getComputedStyle
Gets computed style for the specified element. Computed style indicates the computed values of all CSS properties of the element.
window.getSelection
Returns the selection object representing the selected item(s).
window.home
Returns the browser to the home page.
window.moveBy
Moves the current window by a specified amount.
window.moveTo
Moves the window to the specified coordinates.
window.open
Opens a new window.
window.openDialog
Opens a new dialog window.
window.print
Opens the Print Dialog to print the current document.
window.prompt
Returns the text entered by the user in a prompt dialog.
window.releaseEvents {{template.Obsolete_inline()}}
Releases the window from trapping events of a specific type.
window.resizeBy
Resizes the current window by a certain amount.
window.resizeTo
Dynamically resizes window.
window.scroll
Scrolls the window to a particular place in the document.
window.scrollBy
Scrolls the document in the window by the given amount.
window.scrollByLines
Scrolls the document by the given number of lines.
window.scrollByPages
Scrolls the current document by the specified number of pages.
window.scrollTo
Scrolls to a particular set of coordinates in the document.
window.setInterval
Execute a function each X milliseconds.
window.setTimeout
Sets a delay for executing a function.
window.sizeToContent
Sizes the window according to its content.
window.stop
This method stops window loading.
window.unescape
Unencodes a value that has been encoded in hexadecimal (e.g. a cookie).
window.updateCommands
Updates the state of commands of the current chrome window (UI).

Event Handlers

window.onabort
An event handler property for abort events on the window.
window.onblur
An event handler property for blur events on the window.
window.onchange
An event handler property for change events on the window.
window.onclick
An event handler property for click events on the window.
window.onclose
An event handler property for handling the window close event.
window.ondragdrop
An event handler property for drag and drop events on the window.
window.onerror
An event handler property for errors raised on the window.
window.onfocus
An event handler property for focus events on the window.
window.onkeydown
An event handler property for keydown events on the window.
window.onkeypress
An event handler property for keypress events on the window.
window.onkeyup
An event handler property for keyup events on the window.
window.onload
An event handler property for window loading.
window.onmousedown
An event handler property for mousedown events on the window.
window.onmousemove
An event handler property for mousemove events on the window.
window.onmouseout
An event handler property for mouseout events on the window.
window.onmouseover
An event handler property for mouseover events on the window.
window.onmouseup
An event handler property for mouseup events on the window.
window.onpaint
An event handler property for paint events on the window.
window.onreset
An event handler property for reset events on the window.
window.onresize
An event handler property for window resizing.
window.onscroll
An event handler property for window scrolling.
window.onselect
An event handler property for window selection.
window.onsubmit
An event handler property for submits on window forms.
window.onunload
An event handler property for unload events on the window.
{{ wiki.languages( { "es": "es/DOM/window", "fr": "fr/DOM/window", "ja": "ja/DOM/window", "pl": "pl/DOM/window" } ) }}

修订版来源

<p>
{{template.DomRef()}}
This section provides a brief reference for all of the methods, properties, and events available through the DOM <code>window</code> object. The <code>window</code> object implements the <code>Window</code> interface, which in turn inherits from the <code><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-AbstractView">AbstractView</a></code> interface.
</p><p>The <code>window</code> object represents the window itself. The <code>document</code> property of a <code>window</code> points to the <a href="cn/DOM/document">DOM document</a> loaded in that window. A window for a given document can be obtained using the {{template.Domxref("document.defaultView")}} property.
</p><p>In a tabbed browser, such as Firefox, each tab contains its own <code>window</code> object (and if you're writing an extension, the browser window itself is a separate window too - see <a href="cn/Working_with_windows_in_chrome_code#Content_windows">Working with windows in chrome code</a> for more information). That is, the <code>window</code> object is not shared between tabs in the same window. Some methods, namely {{template.Domxref("window.resizeTo")}} and {{template.Domxref("window.resizeBy")}} apply to the whole window and not to the specific tab the <code>window</code> object belongs to. Generally, anything that can't reasonably pertain to a tab pertains to the window instead.
</p>
<h3 name="Properties"> Properties </h3>
<dl><dt> <a href="cn/Components_object">window.Components</a>
</dt><dd> The entry point to many <a href="cn/XPCOM">XPCOM</a> features. Some properties, e.g. <a href="cn/Components.classes">classes</a>, are only available to sufficiently privileged code.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.content">window.content</a> and window._content
</dt><dd> Returns a reference to the content element in the current window. The variant with underscore is deprecated.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.closed">window.closed</a>
</dt><dd> This property indicates whether the current window is closed or not.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.controllers">window.controllers</a>
</dt><dd> Returns the XUL controller objects for the current chrome window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.crypto">window.crypto</a>
</dt><dd> Returns the browser crypto object.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.defaultStatus">window.defaultStatus</a>
</dt><dd> Gets/sets the status bar text for the given window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.directories">window.directories</a>
</dt><dd> Returns a reference to the directories toolbar in the current chrome.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.document">window.document</a>
</dt><dd> Returns a reference to the document that the window contains.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.frameElement">window.frameElement</a>
</dt><dd> Returns the element in which the window is embedded, or null if the window is not embedded.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.frames">window.frames</a>
</dt><dd> Returns an array of the subframes in the current window.
</dd></dl>
<dl><dt> <a href="cn/DOM/Storage#globalStorage">window.globalStorage</a>
</dt><dd> Multiple storage objects that are used for storing data across multiple pages.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.history">window.history</a>
</dt><dd> Returns a reference to the history object.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.innerHeight">window.innerHeight</a>
</dt><dd> Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.innerWidth">window.innerWidth</a>
</dt><dd> Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.length">window.length</a>
</dt><dd> Returns the number of frames in the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.location">window.location</a>
</dt><dd> Gets/sets the location, or current URL, of the window object.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.locationbar">window.locationbar</a>
</dt><dd> Returns the locationbar object, whose visibility can be toggled in the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.menubar">window.menubar</a>
</dt><dd> Returns the menubar object, whose visibility can be toggled in the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.name">window.name</a>
</dt><dd> Gets/sets the name of the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.navigator">window.navigator</a>
</dt><dd> Returns a reference to the navigator object.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.opener">window.opener</a>
</dt><dd> Returns a reference to the window that opened this current window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.outerHeight">window.outerHeight</a>
</dt><dd> Gets the height of the outside of the browser window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.outerWidth">window.outerWidth</a>
</dt><dd> Gets the width of the outside of the browser window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.pageXOffset">window.pageXOffset</a>
</dt><dd> Gets the amount of content that has been hidden by scrolling to the right.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.pageYOffset">window.pageYOffset</a>
</dt><dd> Gets the amount of content that has been hidden by scrolling down.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.parent">window.parent</a>
</dt><dd> Returns a reference to the parent of the current window or subframe.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.personalbar">window.personalbar</a>
</dt><dd> Returns the personalbar object, whose visibility can be toggled in the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.pkcs11">window.pkcs11</a>
</dt><dd> Returns the pkcs11 object, which can be used to install drivers and other software associated with the pkcs11 protocol.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.screen">window.screen</a>
</dt><dd> Returns a reference to the screen object associated with the window.
</dd></dl>
<p><span class="comment">The following is duplicated on DOM:window.screen</span>
</p>
<dl><dt> <a href="cn/DOM/window.screen.availTop">window.screen.availTop</a>
</dt><dd> Specifies the y-coordinate of the first pixel that is not allocated to permanent or semipermanent user interface features.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.screen.availLeft">window.screen.availLeft</a>
</dt><dd> Returns the first available pixel available from the left side of the screen.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.screen.availHeight">window.screen.availHeight</a>
</dt><dd> Specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.screen.availWidth">window.screen.availWidth</a>
</dt><dd> Returns the amount of horizontal space in pixels available to the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.screen.colorDepth">window.screen.colorDepth</a>
</dt><dd> Returns the color depth of the screen.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.screen.height">window.screen.height</a>
</dt><dd> Returns the height of the screen in pixels.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.screen.left">window.screen.left</a>
</dt><dd> Gets/sets the current distance in pixels from the left side of the screen.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.screen.pixelDepth">window.screen.pixelDepth</a>
</dt><dd> Gets the bit depth of the screen.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.screen.top">window.screen.top</a>
</dt><dd> Gets/sets the distance from the top of the screen.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.screen.width">window.screen.width</a>
</dt><dd> Returns the width of the screen.
</dd></dl>
<p><span class="comment">end of duplicated content</span>
</p>
<dl><dt> <a href="cn/DOM/window.screenX">window.screenX</a>
</dt><dd> Returns the horizontal distance of the left border of the user's browser from the left side of the screen.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.screenY">window.screenY</a>
</dt><dd> Returns the vertical distance of the top border of the user's browser from the top side of the screen.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.scrollbars">window.scrollbars</a>
</dt><dd> Returns the scrollbars object, whose visibility can be toggled in the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.scrollMaxX">window.scrollMaxX</a>
</dt><dd> The maximum offset that the window can be scrolled to horizontally.
</dd><dd> (i.e., the document width minus the viewport width)
</dd></dl>
<dl><dt> <a href="cn/DOM/window.scrollMaxY">window.scrollMaxY</a>
</dt><dd> The maximum offset that the window can be scrolled to vertically.
</dd><dd> (i.e., the document height minus the viewport height)
</dd></dl>
<dl><dt> <a href="cn/DOM/window.scrollX">window.scrollX</a>
</dt><dd> Returns the number of pixels that the document has already been scrolled horizontally.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.scrollY">window.scrollY</a>
</dt><dd> Returns the number of pixels that the document has already been scrolled vertically.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.self">window.self</a>
</dt><dd> Returns an object reference to the window object itself.
</dd></dl>
<dl><dt> <a href="cn/DOM/Storage#sessionStorage">window.sessionStorage</a>
</dt><dd> A storage object for storing data within a single page session.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.sidebar">window.sidebar</a>
</dt><dd> Returns a reference to the window object of the sidebar.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.status">window.status</a>
</dt><dd> Gets/sets the text in the statusbar at the bottom of the browser.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.statusbar">window.statusbar</a>
</dt><dd> Returns the statusbar object, whose visibility can be toggled in the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.toolbar">window.toolbar</a>
</dt><dd> Returns the toolbar object, whose visibility can be toggled in the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.top">window.top</a>
</dt><dd> Returns a reference to the topmost window in the window hierarchy.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.window">window.window</a>
</dt><dd> Returns a reference to the current window.
</dd></dl>
<h3 name="Methods"> Methods </h3>
<dl><dt> <a href="cn/DOM/window.alert">window.alert</a>
</dt><dd> Displays an alert dialog.
</dd></dl>
<p><span class="comment">base64 func https://bugzilla.mozilla.org/show_bug.cgi?id=287112 (see last comments) https://bugzilla.mozilla.org/show_bug.cgi?id=123003 http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsGlobalWindow.cpp#4946</span>
</p>
<dl><dt> <a href="cn/DOM/window.atob">window.atob</a>
</dt><dd> Decodes a string of data which has been encoded using base-64 encoding.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.back">window.back</a>
</dt><dd> Moves back one in the window history.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.blur">window.blur</a>
</dt><dd> Sets focus away from the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.btoa">window.btoa</a>
</dt><dd> Creates a base-64 encoded ASCII string from a string of binary data.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.captureEvents">window.captureEvents</a> {{template.Obsolete_inline()}}
</dt><dd> Registers the window to capture all events of the specified type.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.clearInterval">window.clearInterval</a>
</dt><dd> Cancels the repeated execution set using <code>setInterval</code>.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.clearTimeout">window.clearTimeout</a>
</dt><dd> Clears a delay that's been set for a specific function.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.close">window.close</a>
</dt><dd> Closes the current window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.confirm">window.confirm</a>
</dt><dd> Displays a dialog with a message that the user needs to respond to.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.dump">window.dump</a>
</dt><dd> Writes a message to the console.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.escape">window.escape</a>
</dt><dd> Encodes a string.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.find">window.find</a>
</dt><dd> Searches for a given string in a window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.focus">window.focus</a>
</dt><dd> Sets focus on the current window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.forward">window.forward</a>
</dt><dd> Moves the window one document forward in the history.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.getAttention">window.getAttention</a>
</dt><dd> Flashes the application icon.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.getComputedStyle">window.getComputedStyle</a>
</dt><dd> Gets computed style for the specified element. Computed style indicates the computed values of all CSS properties of the element.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.getSelection">window.getSelection</a>
</dt><dd> Returns the selection object representing the selected item(s).
</dd></dl>
<dl><dt> <a href="cn/DOM/window.home">window.home</a>
</dt><dd> Returns the browser to the home page.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.moveBy">window.moveBy</a>
</dt><dd> Moves the current window by a specified amount.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.moveTo">window.moveTo</a>
</dt><dd> Moves the window to the specified coordinates.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.open">window.open</a>
</dt><dd> Opens a new window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.openDialog">window.openDialog</a>
</dt><dd> Opens a new dialog window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.print">window.print</a>
</dt><dd> Opens the Print Dialog to print the current document.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.prompt">window.prompt</a>
</dt><dd> Returns the text entered by the user in a prompt dialog.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.releaseEvents">window.releaseEvents</a> {{template.Obsolete_inline()}}
</dt><dd> Releases the window from trapping events of a specific type.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.resizeBy">window.resizeBy</a>
</dt><dd> Resizes the current window by a certain amount.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.resizeTo">window.resizeTo</a>
</dt><dd> Dynamically resizes window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.scroll">window.scroll</a>
</dt><dd> Scrolls the window to a particular place in the document.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.scrollBy">window.scrollBy</a>
</dt><dd> Scrolls the document in the window by the given amount.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.scrollByLines">window.scrollByLines</a>
</dt><dd> Scrolls the document by the given number of lines.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.scrollByPages">window.scrollByPages</a>
</dt><dd> Scrolls the current document by the specified number of pages.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.scrollTo">window.scrollTo</a>
</dt><dd> Scrolls to a particular set of coordinates in the document.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.setInterval">window.setInterval</a>
</dt><dd> Execute a function each X milliseconds.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.setTimeout">window.setTimeout</a>
</dt><dd> Sets a delay for executing a function.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.sizeToContent">window.sizeToContent</a>
</dt><dd> Sizes the window according to its content.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.stop">window.stop</a>
</dt><dd> This method stops window loading.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.unescape">window.unescape</a>
</dt><dd> Unencodes a value that has been encoded in hexadecimal (e.g. a cookie).
</dd></dl>
<dl><dt> <a href="cn/DOM/window.updateCommands">window.updateCommands</a>
</dt><dd> Updates the state of commands of the current chrome window (UI).
</dd></dl>
<h3 name="Event_Handlers"> Event Handlers </h3>
<dl><dt> <a href="cn/DOM/window.onabort">window.onabort</a>
</dt><dd> An event handler property for abort events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onblur">window.onblur</a>
</dt><dd> An event handler property for blur events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onchange">window.onchange</a>
</dt><dd> An event handler property for change events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onclick">window.onclick</a>
</dt><dd> An event handler property for click events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onclose">window.onclose</a>
</dt><dd> An event handler property for handling the window close event.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.ondragdrop">window.ondragdrop</a>
</dt><dd> An event handler property for drag and drop events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onerror">window.onerror</a>
</dt><dd> An event handler property for errors raised on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onfocus">window.onfocus</a>
</dt><dd> An event handler property for focus events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onkeydown">window.onkeydown</a>
</dt><dd> An event handler property for keydown events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onkeypress">window.onkeypress</a>
</dt><dd> An event handler property for keypress events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onkeyup">window.onkeyup</a>
</dt><dd> An event handler property for keyup events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onload">window.onload</a>
</dt><dd> An event handler property for window loading.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onmousedown">window.onmousedown</a>
</dt><dd> An event handler property for mousedown events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onmousemove">window.onmousemove</a>
</dt><dd> An event handler property for mousemove events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onmouseout">window.onmouseout</a>
</dt><dd> An event handler property for mouseout events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onmouseover">window.onmouseover</a>
</dt><dd> An event handler property for mouseover events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onmouseup">window.onmouseup</a>
</dt><dd> An event handler property for mouseup events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onpaint">window.onpaint</a>
</dt><dd> An event handler property for paint events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onreset">window.onreset</a>
</dt><dd> An event handler property for reset events on the window.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onresize">window.onresize</a>
</dt><dd> An event handler property for window resizing.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onscroll">window.onscroll</a>
</dt><dd> An event handler property for window scrolling.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onselect">window.onselect</a>
</dt><dd> An event handler property for window selection.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onsubmit">window.onsubmit</a>
</dt><dd> An event handler property for submits on window forms.
</dd></dl>
<dl><dt> <a href="cn/DOM/window.onunload">window.onunload</a>
</dt><dd> An event handler property for unload events on the window.
</dd></dl>
<div class="noinclude">
</div>
{{ wiki.languages( { "es": "es/DOM/window", "fr": "fr/DOM/window", "ja": "ja/DOM/window", "pl": "pl/DOM/window" } ) }}
恢复到这个版本