The Window Object

The windows object has the following properties and methods:

NameDescriptionReturns
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
defaultViewReturns the Window for the active document.Window
documentReturns the Document object associated with this window.Document
focus()Focuses the window.void
framesReturns an array of the Window objects for the iframe elements.Window[]
historyReturns the browser history.History
innerHeightGets the height of the window content area.number
innerWidthGets the width window content area.number
lengthReturns the number of nested iframe elements in the document.number
locationReturns the current document's location.Location
openerReturns the Window that opened the current browsing context.Window
outerHeightGets the height of the window, including borders, menu bars, etc.number
outerWidthGets the width of the window, including borders, menu bars, etc.number
pageXOffetGets the number of pixels that the window has been scrolled horizontally from the topleft corner.number
pageYOffsetGets the number of pixels that the window has been scrolled vertically from the top-left corner.number
parentReturns 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
screenReturns a Screen object describing the screen.Screen
screenLeft/screenXGets the number of pixels from the left edge of the window to the left edge of the screen.number
screenTop/screenYGets 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
selfReturns 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
topReturns the top-most Window.Window
Home 
  JavaScript Book 
    DOM  

Window:
  1. The Window Object
  2. The Window Events
  3. window.alert() or alert()
  4. window.close()
  5. window.confirm() or confirm()
  6. window.find() displays find dialog
  7. window's outer width and height, inner height and width
  8. window.location
  9. window.moveBy(distance, distance)
  10. window.moveTo(x,y) moves the window to the upper-left coordinate
  11. window.open()
  12. window.print()
  13. window.prompt() and prompt()
  14. window.resizeTo(x,y) and window.resizeBy(xDelta,yDelta)
  15. window.scrollTo(x,y)
  16. window.screenLeft, window.screenX, window.screenTop, window.screenY
  17. window.setInterval() or setInterval()
  18. window.setTimeout() or setTimeout()
  19. Pop-up Blockers