Platform Support
IE | Mozilla | Netscape | Opera | Safari | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
---|
Constructors
Constructor | Action | IE | Mozilla | Netscape | Opera | Safari | ||
---|---|---|---|---|---|---|---|---|
Window Constructor() : Window
Creates a new instance of a Window object.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||
Window() : WindowCreates a new instance of a Window object. Returns
|
Properties
Property | Action | IE | Mozilla | Netscape | Opera | Safari |
---|---|---|---|---|---|---|
defaultStatus
: String
Gets or sets the default text in the status bar at the bottom of a web browser window.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
name
: String
Gets or sets the name of a window.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Fires when the loading of the element is cancelled before it finishes loading.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires immediately after a user prints or print previews a document.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires immediately before a user prints or print previews a document.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires immediately before a document is unloaded.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
static onblur
: Function
Event handler for blur events on a window.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Fires when the value of the element changes.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the element is clicked.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the user closes the window.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when a user drops a file onto the window.
|
No Details | no | no | 4.0+ | no | no |
|
||||||
static onerror
: Function
Event handler for errors raised on a window.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
static onfocus
: Function
Event handler for focus events on a window.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Fires when a user presses the F1 key to activate help.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires when a user presses down on a key while the element has focus.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when a user presses a key or holds down the key while the element has focus.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when a user releases a key while the element has focus.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
static onload
: Function
Event handler for window loading.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Fires when a user clicks down on the mouse button while the element has focus.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the mouse moves while the pointer over the element.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the mouse pointer moves off of the element.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the mouse pointer moves over the element.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the user releases the mouse button while the element has focus.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Event handler for window move events.
|
No Details | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ |
|
||||||
Fires when the form data is reset.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
static onresize
: Function
Event handler for window resizing.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Fires when a user scrolls the element.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires when the element is selected.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the form data is submitted.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
static onunload
: Function
Event handler for unload events on the window.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
status
: String
Gets or sets the text in the status bar at the bottom of a web browser window.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Indicates whether a window is closed or not.
|
No Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
document
: Document
Reference to the document that the window contains.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
event
: Event
Instance of an Event that is available to an event handler.
|
Show Details | 4.0+ | no | no | 7.0+ | 1.0+ |
|
||||||
An array of the frames in the current window.
|
No Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
history
: History
Reference to the History object.
|
Show Details | 3.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
Height of the active document area of the window.
|
No Details | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ |
|
||||||
Width of the active document area of the window.
|
No Details | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ |
|
||||||
Number of frames in the window.
|
No Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Gets or sets the current URL of a window.
|
No Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Math
: Math
Reference to an object holding math functions and constants.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | no | no |
|
||||||
navigator
: Navigator
Reference to the Navigator object.
|
Show Details | 3.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
Reference to the window that opened the current window.
|
No Details | 3.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
Reference to the parent of the current window or subframe.
|
No Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
screen
: Screen
Reference to the Screen object associated with the window.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
Reference to a Window object itself.
|
No Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Reference to the top window in the window hierarchy.
|
No Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
window
: Window
Reference to the current Window.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
XMLHttpRequest
: XMLHttpRequest
Reference to an XMLHttpRequest object.
|
Show Details | 5.0+ | 1.0+ | 7.0+ | no | 1.2+ |
|
Functions
Method | Action | IE | Mozilla | Netscape | Opera | Safari | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
alert() : void
Displays an alert dialogue box.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Returns
|
||||||||||||||||||||
back() : void
Moves back one step in the Window history.
|
Show Details | 1.0+ | 4.0+ | 7.0+ | 1.0+ | |||||||||||||||
Returns
|
||||||||||||||||||||
blur() : void
Removes focus from the Window.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | ||||||||||||||
Returns
|
||||||||||||||||||||
captureEvents(Number eventmask) : void
Sets the Window to capture all events of the specified type.
|
Show Details | no | no | 4.0+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
clearInterval(Object intervalId) : void
Clears a delay that was set with the setInterval method.
|
Show Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
clearTimeout(Object timeoutId) : void
Clears a timeout that was set with the setTimeout method.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
close() : void
Closes the current window.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Returns
|
||||||||||||||||||||
confirm(String question) : Boolean
Displays a confirmation dialogue box.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
focus() : void
Sets the focus on the current Window.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | ||||||||||||||
Returns
|
||||||||||||||||||||
forward() : void
Moves forward one step in the Window history.
|
Show Details | no | no | 4.0+ | 7.0+ | no | ||||||||||||||
Returns
|
||||||||||||||||||||
static getComputedStyle(Element elt, String pseudoElt) : CSSStyleDeclaration
Computes style information and returns the CSSStyleDeclaration for the specified document Element.
|
Show Details | 6.0+ | 1.0+ | 6.0+ | no | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
handleEvent(Object event) : Object
Calls the event handler for the specified event.
|
Show Details | no | no | 4.0+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
home() : void
Returns the browser Window to the browser home page.
|
Show Details | no | no | 4.0+ | 7.0+ | no | ||||||||||||||
Returns
|
||||||||||||||||||||
moveBy(Number dx, Number dy) : void
Moves a Window by the specified amount.
|
Show Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
moveTo(Object x, Object y) : void
Moves the Window to the specified location.
|
Show Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
navigate(String url) : void
Automatically navigates to the specified URL.
|
Show Details | 3.0+ | no | no | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
open([String url,] [String name,] [String features,] [Boolean replace]) : Window
Opens a new Window.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
print() : void
Prints the contents of the current Window.
|
Show Details | 5.0+ | 1.0+ | 4.0+ | 7.0+ | no | ||||||||||||||
Returns
|
||||||||||||||||||||
prompt(String message, String default) : String|Number
Displays a dialogue box that prompts the user for input.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
releaseEvents(Number eventmask) : void
Sets the Window to release all captured events of a specified type.
|
Show Details | no | no | 4.0+ | 7.0+ | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
resizeBy(Number dw, Number dh) : void
Resizes the current window by the specified amount.
|
Show Details | 4.0+ | no | 4.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
resizeTo(Object width, Object height) : void
Resizes the current window to the specified size.
|
Show Details | 4.0+ | no | 4.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
routeEvent(Function event) : Object
Routes a captured event through the event hierarchy.
|
Show Details | no | no | 4.0+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
scroll(Object x, Object y) : void
Scrolls the window to a specified place in the document.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | no | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
scrollBy(Number dx, Number dy) : void
Scrolls the current document in the window by the specified amount.
|
Show Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
scrollTo(Object x, Object y) : void
Scrolls the window to a specified place in the document.
|
Show Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
setInterval(String code, Function func, Number interval, Array args...) : Number
Calls a function or evaluates an expression every time the specified interval elapses.
|
Show Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
setTimeout(String code, Function func, String delay, Array args) : Number
Specifies a delay for calling a function or evaluating an expression.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
stop() : void
Stops the window from loading.
|
Show Details | no | no | 4.0+ | 7.0+ | no | ||||||||||||||
Returns
|
References
Availability
JavaScript 1.0|enhanced in JavaScript 1.1 and 1.2