Window
The windows object has the following properties and methods:
Name | Description | Returns |
---|---|---|
alert(msg) | Displays a message dialog window. | void |
blur() | Unfocuses the window. | void |
clearInterval(id) | Cancels an interval timer. | void |
clearTimeout(id) | Cancels a timeout timer. | void |
close() | Closes the window. | void |
confirm(msg) | Displays a OK/Cancel prompt dialog. | boolean |
defaultView | Returns the Window for the active document. | Window |
document | Returns the Document object associated with this window. | Document |
focus() | Focuses the window. | void |
find() | find dialog. | void |
frames | Returns an array of the Window objects for the iframe elements. | Window[] |
history | Returns the browser history. | History |
innerHeight | Gets the height of the window content area. | number |
innerWidth | Gets the width window content area. | number |
length | Returns the number of nested iframe elements in the document. | number |
location | Returns the current document's location. | Location |
moveby | move by a certain amount | void |
moveto | move to a position | void |
open() | open a new window | Reference to the window |
opener | Returns the Window that opened the current browsing context. | Window |
outerHeight | Gets the height of the window, including borders, menu bars, etc. | number |
outerWidth | Gets the width of the window, including borders, menu bars, etc. | number |
pageXOffet | Gets the number of pixels that the window has been scrolled horizontally from the topleft corner. | number |
pageYOffset | Gets the number of pixels that the window has been scrolled vertically from the top-left corner. | number |
parent | Returns the parent of the current Window. | Window |
postMessage(msg, origin) | Sends the message to another document. | void |
print() | Prompts the user to print the page. | void |
prompt(msg, val) | Displays a dialog prompting the user to enter a value. | string |
resizeTo(x,y) | Resize the window | |
screen | Returns a Screen object describing the screen. | Screen |
screenLeft/screenX | Gets the number of pixels from the left edge of the window to the left edge of the screen. | number |
screenTop/screenY | Gets the number of pixels from the top edge of the window to the top edge of the screen. | number |
scrollBy(x, y) | Scrolls the document relative to its current position. | void |
scrollTo(x, y) | Scrolls to the specified position. | void |
self | Returns the Window for the current document. | Window |
setInterval(function, time) | Creates a timer that will call the specified function every time milliseconds. | int |
setTimeout(function, time) | Creates a timer that will call the specified function once after time milliseconds. | int |
showModalDialog(url) | Displays a pop-up window showing the specified URL. | void |
stop() | Stops the document loading. | void |
top | Returns the top-most Window. | Window |