Methods of the Window Object

The table below lists the most commonly used methods of the window object with a short description for each method.

MethodProperty
alert()Pops up an alert to the viewer who must then click OK to proceed.
back()Takes the window back one item in the history list.
blur()Removes the focus from a window.
clearInterval()Cancels the action of a setTimeout() method call.
clearTimeout()Cancels the action of a setTimeout() method call.
close()Closes a browser window.
confirm()Displays a confirmation dialog box to the viewer who must then click OK or Cancel to proceed.
escape()Converts special characters in a string of hexadecimal characters.
find()Enables the viewer to launch the Find utility in the browser to find text on a page.
focus()Gives the focus to a window.
forward()Takes the window one item forward in the history list.
home()Sends the viewer to the home page the viewer has set in the browser settings.
moveBy()Moves a window by certain pixel values that are sent as parameters.
moveTo()Moves the top-left corner of the window to the coordinates set as parameters.
open()Opens a new browser window.
print()Prints the content of the window.
prompt()Pops up a prompt dialog box asking the viewer to input information.
resizeBy()Resizes a window by moving the bottom-right corner by certain pixel values that are sent as parameters.
resizeTo()Resize an entire window to the height and width that are sent as parameters.
scrollBy()Scrolls the viewing area of a window by certain pixel values that are sent as parameters.
scrollTo()Scrolls the viewing area of the window to the specified coordinates that are sent as parameters.
setInterval()Calls a function each time a certain amount of time passes.
setTimeout()Calls a function once certain amount of time has passed.
stop()Stops a window from loading its content.
unescape()Converts an escaped string back to its normal characters.