2 out of 6 rated this helpful - Rate this topic

Window Prototype

Defines the properties and methods inherited by objects in the Window prototype chain.

Syntax

HTML N/A
Scripting Window.prototype

Members Table

The following table lists the members exposed by the Window Constructor object.

Attributes/Properties

Attribute Property Description
closed Retrieves whether the referenced window is closed.
defaultStatus Sets or retrieves the default message displayed in the status bar at the bottom of the window.
document

Retrieves the HTML document in a given popup window.

EVENT event Sets or retrieves the event for which the script is written.
frameElement Retrieves the frame or iframe object that is hosting the window in the parent document.
length Gets or sets the number of objects in a collection.
localStorage Retrieves the Web Storage area specific to the current document.
maxConnectionsPerServer Retrieves the maximum number of concurrent connections to a Web server.
name Sets or retrieves a value that indicates the window name.
offscreenBuffering Sets or retrieves whether objects are drawn offscreen before being made visible to the user.
opener Sets or retrieves a reference to the window that created the current window.
parent Retrieves the parent of the window in the object hierarchy.
screenLeft Retrieves the x-coordinate of the upper left-hand corner of the window frame, relative to the upper left-hand corner of the screen.
screenTop Retrieves the y-coordinate of the top corner of the client area, relative to the top corner of the screen.
self Retrieves a reference to the current window or frame.
sessionStorage Retrieves the Web Storage area for the session.
status Sets or retrieves the message in the status bar at the bottom of the window.
top Retrieves the topmost ancestor window.

Collections

Collection Description
frames Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window.

Events

Event Event Property Description
abort New for Windows Internet Explorer 9  onabort Fires when the user aborts the download.
onafterprint Fires on the object immediately after its associated document prints or previews for printing.
onbeforeprint Fires on the object before its associated document prints or previews for printing.
http://msdn.microsoft.com/en-us/library/ms536907 onbeforeunload Fires prior to a document being unloaded.
blur onblur Fires when the object loses the input focus.
drag New for Internet Explorer 9  ondrag Fires on the source object continuously during a drag operation.
dragend New for Internet Explorer 9  ondragend Fires on the source object when the user releases the mouse at the close of a drag operation.
dragenter New for Internet Explorer 9  ondragenter Fires on the target element when the user drags the object to a valid drop target.
dragleave New for Internet Explorer 9  ondragleave Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
dragover New for Internet Explorer 9  ondragover Fires on the target element continuously while the user drags the object over a valid drop target.
dragstart New for Internet Explorer 9  ondragstart Fires on the source object when the user starts to drag a text selection or selected object.
drop New for Internet Explorer 9  ondrop Fires on the target object when the mouse button is released during a drag-and-drop operation.
error onerror Fires when an error occurs during object loading.
focus onfocus Fires when the object receives focus.
focusin New for Internet Explorer 9  onfocusin Fires for an element just prior to setting focus on that element.
focusout New for Internet Explorer 9  onfocusout Fires for the current element with focus immediately after moving focus to another element.
onhashchange

Raised when there are changes to the portion of a URL that follows the number sign (#).

onhelp Fires when the user presses the F1 key while the client is the active window.
input New for Internet Explorer 9  oninput Occurs when the text content of an element is changed through the user interface.
keydown New for Internet Explorer 9  onkeydown Fires when the user presses a key.
keypress New for Internet Explorer 9  onkeypress Fires when the user presses an alphanumeric key.
keyup New for Internet Explorer 9  onkeyup Fires when the user releases a key.
load onload Fires immediately after the client loads the object.
mousedown New for Internet Explorer 9  onmousedown Fires when the user clicks the object with either mouse button.
mousemove New for Internet Explorer 9  onmousemove Fires when the user moves the mouse over the object.
mouseout New for Internet Explorer 9  onmouseout Fires when the user moves the mouse pointer outside the boundaries of the object.
mouseover New for Internet Explorer 9  onmouseover Fires when the user moves the mouse pointer into the object.
mouseup New for Internet Explorer 9  onmouseup Fires when the user releases a mouse button while the mouse is over the object.
mousewheel New for Internet Explorer 9  onmousewheel Fires when the wheel button is rotated.
offline New for Internet Explorer 9  onoffline

Raised when Internet Explorer is working offline.

online New for Internet Explorer 9  ononline

Raised when Internet Explorer is working online.

readystatechange New for Internet Explorer 9  onreadystatechange Fires when the state of the object has changed.
onreset New for Internet Explorer 9  Fires when the user resets a form.
http://msdn.microsoft.com/en-us/library/ms536959 onresize Fires when the size of the object is about to change.
scroll onscroll Fires when the user repositions the scroll box in the scroll bar on the object.
select New for Internet Explorer 9  onselect Fires when the current selection changes.
storage New for Internet Explorer 9  onstorage Fires when a Web Storage area is updated.
onunload Fires immediately before the object is unloaded.

Methods

Method Description
addEventListener New for Internet Explorer 9  Registers an event handler for the specified event type.
alert

Displays a dialog box containing an application-defined message.

attachEvent Binds the specified function to an event, so that the function gets called whenever the event fires on the object.
blur Causes the element to lose focus and fires the onblur event.
clearInterval Cancels the interval previously started using the setInterval method.
clearTimeout Cancels a time-out that was set with the setTimeout method.
close

Closes the current browser window or HTML Application (HTA).

confirm

Displays a confirmation dialog box that contains an optional message as well as OK and Cancel buttons.

createPopup Creates a popup window object.
detachEvent Unbinds the specified function from the event, so that the function stops receiving notifications when the event fires.
dispatchEvent New for Internet Explorer 9  Sends an event to the current element.
execScript Executes the specified script in the provided language.
focus Causes the element to receive the focus and executes the code specified by the onfocus event.
item Retrieves an object from various collections, including the all collection.
moveBy

Moves the screen position of the window by the specified x and y offset values.

moveTo

Moves the screen position of the upper-left corner of the window to the specified x and y position.

navigate Loads the specified URL to the current window.
open

Opens a new window and loads the document specified by a given URL.

postMessage Sends a cross-document message.
print Prints the document associated with the window.
prompt

Displays a dialog box that prompts the user with a message and an input field.

removeEventListener New for Internet Explorer 9  Removes an event handler that the addEventListener method registered.
resizeBy

Changes the current size of the window by the specified x- and y-offset.

resizeTo

Sets the size of the window to the specified width and height values.

scroll Causes the window to scroll to the specified x- and y-offset at the upper-left corner of the window.
scrollBy Causes the window to scroll relative to the current scrolled position by the specified x- and y-pixel offset.
scrollTo Scrolls the window to the specified x- and y-offset.
setInterval Evaluates an expression each time a specified number of milliseconds has elapsed.
setTimeout Evaluates an expression after a specified number of milliseconds has elapsed.
showHelp

Displays a Help file. This method can be used with Microsoft HTML Help.

showModalDialog

Creates a modal dialog box that displays the specified HTML document.

showModelessDialog

Creates a modeless dialog box that displays the specified HTML document.

toStaticHTML Removes dynamic HTML elements and attributes from an HTML fragment.

Objects

Object Description
clientInformation

Contains information about the browser.

clipboardData Provides access to predefined clipboard formats for use in editing operations.
external

Allows access to an additional object model provided by host applications of the Internet Explorer browser components.

history

Contains information about the URLs visited by the client.

Image Creates and initializes a new img element.
location Contains information about the current URL.
navigator Contains information about the client.
Option Creates and initializes a new option element.
screen Contains information about the client's screen and rendering capabilities.

Remarks

For more information on this and other DOM Prototypes see Document Object Model Prototypes, Part 1: Introduction.

This prototype does not derive from any objects.

Applies To

window

See Also

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ