window (JavaScript 1.0)

The Window object represents the web browser window. It provides access to objects to use to manipulate the browsing environment and properties for accessing the object model below it.

Properties & Events

KeyDescriptionAvailability
closedIndicates whether a window is closed or not.
chrome 1.0safari 1.0Firefox 1.0ie 4.0opera 7.0
defaultstatusGets or sets the default text in the status bar at the bottom of a web browser window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
documentReference to the document that the window contains.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
eventInstance of an Event that is available to an event handler.
chrome 1.0safari 1.0Firefox ??ie 4.0opera 7.0
framesAn array of the frames in the current window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
historyReference to the History object.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
lengthNumber of frames in the window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
locationGets or sets the current URL of a window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
nameGets or sets the name of a window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
navigatorReference to the Navigator object.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
openerReference to the window that opened the current window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
parentReference to the parent of the current window or subframe.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
screenReference to the Screen object associated with the window.
chrome 1.0safari 1.0Firefox 1.0ie 4.0opera 7.0
selfReference to a Window object itself.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
statusGets or sets the text in the status bar at the bottom of a web browser window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
topReference to the top window in the window hierarchy.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
windowReference to the current Window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
xmlhttprequestReference to an XMLHttpRequest object.
chrome 1.2safari 1.2Firefox 1.0ie 5.0opera ??
onblurEvent handler for blur events on a window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
onchangeFires when the value of the element changes.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onclickFires when the element is clicked.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
oncloseFires when the user closes the window.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onerrorEvent handler for errors raised on a window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
onfocusEvent handler for focus events on a window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
onkeydownFires when a user presses down on a key while the element has focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onkeypressFires when a user presses a key or holds down the key while the element has focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onkeyupFires when a user releases a key while the element has focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onloadEvent handler for window loading.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
onmousedownFires when a user clicks down on the mouse button while the element has focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onmousemoveFires when the mouse moves while the pointer over the element.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onmouseoutFires when the mouse pointer moves off of the element.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onmouseoverFires when the mouse pointer moves over the element.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onmouseupFires when the user releases the mouse button while the element has focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onmoveEvent handler for window move events.
chrome 1.0safari 1.0Firefox 1.0ie ??opera 7.0
onresetFires when the form data is reset.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onresizeEvent handler for window resizing.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
onselectFires when the element is selected.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onsubmitFires when the form data is submitted.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onunloadEvent handler for unload events on the window.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0

Result from the Online TryIt-Editor
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 4.0

Examples having uses of: 'window'

1 votes
1k views

HTML5 Canvas Image

The drawImage method allows you to insert other images (img and canvas elements) into your canvas context. To draw an image using HTML5 Canvas, we can use the drawImage() method which requires an image object and a destination point. The destination point is relative to the top left corner of the image.
0 votes
1k views

HTML5 Canvas Text

To align HTML5 Canvas text, we can use the textAlign property of the canvas context, which can be set to start, end, left, center, or right. Unless otherwise specified, the textAlign property is defaulted to left.
0 votes
1k views

JavaScript Keyboard Events

This event are fired when a key is pressed. IE 8 and earlier use event.keyCode to retrieve the key that was pressed down, while Firefox/Chrome/Safari/Opera use event.which.
0 votes
1k views

JavaScript window Object

Create a new window and move new browser window.
0 votes
1k views

JavaScript Print method

Opens a dialog window for printing the current web page.