Contents Quick Reference
The global window object. It has all the properties as the window object for HTML documents, although some properties are not used for anything.
Properties and Methods:
An object that can be used to get XPCOM components and interfaces.
Displays a popup window with the specified text in it. The user can press the OK button to close the window. This is usually used for error messages.
For a window opened with openDialog, the arguments property is an array of the additional parameters after the first three in the openDialog function.
Removes the focus from the window.
Removes the interval specified by the given identifier id.
Removes the timeout specified by the given identifier id.
Closes the window.
Set to the true if the window has been closed.
Displays the specified text to the user in a popup box, along with OK and Cancel buttons. If the user presses OK, true is returned. If the user presses Cancel, false is returned.
Refers to the document object for the file currently displayed in the window.
Prints the specified text to the console. This function is commonly used for debugging.
Returns the text escaped so that is can be part of a URL.
Assigns the focus to the window.
An array of the iframe elements contained in the window.
Returns the values of the style properties as currently displayed to the user. This is the method you would use to get, for example, the current width and height of the element as it is drawn on the window. The pseudo argument is used to get a pseudo-style of an element, for example to get the style of the 'hover' of an element.
Refers to the history for the window.
The height of the inner part of the window. This refers to the window size minus the size of the title bar and frame.
The width of the inner part of the window. This refers to the window size minus the size of the title bar and frame.
The number of frames contained in the window, or the length of the frames array.
Moves the position of the window on the screen by the given x and y position relative to its current position.
Moves the position of the window on the screen to the given x and y position.
The name of the window as was specified by the second argument to the window.open function that opened the window.
Refers to the global navigator object.
Opens a new window containing the contents of the specified url. If the document is a XUL file, you should specify the 'chrome' flag in the flags parameter. This will cause the window to be opened as a chrome. Otherwise, the file will opened as a document and chrome will be supplied around it (typically a browser window). The second argument is a window name which can be used to find the window. Numerous flags are available, some of which are documented here. Additional arguments are passed to the window and are available in its argument array.
Opens a new dialog box containing the contents of the specified url. This is similar to the open method except that some platforms may treat the window differently. For example, it may appear differently or be modal. This function can take additional arguments after the first three which are placed in the new window's arguments property.
Refers to the window object that opened this window.
The height of the outer part of the window. This refers to the window size including the size of the title bar and frame.
The width of the outer part of the window. This refers to the window size including the size of the title bar and frame.
The parent window of this window.
Displays a popup window with a textbox in it. The argument text is displayed to the user above the textbox. The second argument can be used to specify a default value for the textbox. If the user enters text and presses OK, the text is returned from the function. If the user presses Cancel, null is returned.
Changes the size of the window by the given width and height relative to its current size.
Changes the size of the window to the given width and height. The position of the window can be changed with moveTo. If you make it too small, it will disappear from the screen.
The global screen object which contains information about the user's display.
The horizontal position of the window on the screen.
The vertical position of the window on the screen.
If the content of the window is too large to fit within the window frame, scroll bars can optionally appear. This property is used to determine the horizontal scroll position.
If the content of the window is too large to fit within the window frame, scroll bars can optionally appear. This property is used to determine the vertical scroll position.
Refers to the window itself.
Can be used to change the mouse cursor that is used while over the window. The argument is the name of the cursor to use. The cursor change will stay until you change it back (by setting the cursor to 'auto').
A number of cursors are available, some of which might not be available on all platforms.
auto, default, pointer, crosshair, move, text, wait, help, n-resize, s-resize, w-resize, e-resize, ne-resize, nw-resize, se-resize, sw-resize, copy, alias, context-menu, cell, grab, grabbing, spinning, count-up, count-down, count-up-down
Evaluates a string of code repeatedly. The argument time is used to specify the interval between evaluations, measured in milliseconds. This function returns an identifier which can be passed to clearInterval.
Evaluates a string of code after a certain amount of time has passed. The time is measured in milliseconds so use a value of 1000 for one second. If you want to have something every second (or some other time) use setInterval. This function returns an identifier which can be passed to clearTimeout.
Changes the size of the window so that it is just large enough to hold its content.
Refers to the topmost window. This is used to get the outer window from a document that is contained within an iframe.
Returns the text that has been URL-escaped.
Refers to the window itself.