HOME

DHTML Tutorial
DHTML HOME
DHTML Intro
DHTML CSS
DHTML DOM
DHTML Events

DHTML Examples
DHTML Examples

DHTML DOM
DOM window
DOM navigator
DOM event
DOM collection
DOM document
DOM form
DOM input
DOM select
DOM option
DOM textarea
DOM table
DOM tablerow
DOM tablecell
DOM anchor
DOM image
DOM frameset
DOM frame
DOM iframe

DOM Examples
DOM Examples

Please visit our sponsors !

The Window object

previous next

The window object is the top object in the DHTML Object Model, and contains information about the window and the frames.


Window Object Examples

Example IE
5.5
NN
4.7
NN
6.2
Show an alert box X X X
Show the current URL and change it X X X
Display the user's screen properties X X X
Open a new window X X X
Print page X   X
Resize window X X X
Resize window to a specified size X X X
Scroll the window X X X
Scroll the window to a specified position X X X
setTimeout() X X X
confirm() X X X
prompt() X X X


Properties

Property Description
clientInformation Returns a navigator object
closed Returns a Boolean value that indicates whether the window is closed or not
complete Returns a Boolean value that indicates  whether the window is finished loading or not
dataTransfer Returns predefined clipboard formats that can be used when transferring data
defaultStatus Sets or returns the default message in the status bar
dialogArguments Sets or returns the arguments in a dialog box created by showModalDialog() or showModelessDialog()
dialogHeight Sets or returns the height of a dialog box
dialogLeft Sets or returns the left coordinate of a dialog box
dialogTop Sets or returns the top coordinate of a dialog box
dialogWidth Sets or returns the width of a dialog box
document Returns the document object
event Returns the event object
external Returns the host of a Web page
history Returns previously visited URLs
length Returns the number of frames in a window
location Returns the current URL
name Sets or returns the name of the window
navigator Returns a navigator object
offscreenBuffering Indicates whether objects are offscreen before displayed
opener Sets or returns the object that opened the current window
parent Returns the parent object of the current frame
returnValue Sets or returns the return value from a dialog box
screen Returns an object that gives you information about the user's screen
screenLeft Returns the coordinates of the left edge of the client's screen
screenTop Returns the coordinates of the top edge of the client's screen
self Returns the current window object
status Sets or returns the message in the status bar
top Returns the topmost window object

Methods

Method Description
alert() Displays an alert box with a message and an OK button
attachEvent() Attaches the function to an event. The function will be called every time the event is fired
blur() Window loses focus
clearInterval() Clears the setInterval() method
clearTimeout() Clears the setTimeout() method
close() Closes the current window
confirm() Displays a confirm box with a message, a Cancel and an OK button
detachEvent() Detaches a function from an event
execScript() Enables you to execute a script
focus() Sets focus on a specified window
moveBy() Moves the window's position. From the current position 
moveTo() Moves the window to a specified position
navigate() Window navigates to a specified URL
open() Opens a new window
print() Prints the window's document
prompt() Displays a prompt box with a message and an input field
resizeBy() Resizes the window, by the specified x and y offsets
resizeTo() Resizes the window to a specified value
scroll() This method is deprecated in JavaScript 1.2. It has been replaced by scrollTo()
scrollBy() Scrolls the window, from the current scroll position
scrollTo() Scrolls the window to a specified position
setInterval() An expression is valuated each time the specified interval occurs
setTimeout() An expression is valuated after the specified timeout has occurred
showHelp() Displays a specified help file
showModalDialog() Displays a modal dialog box that shows a specified HTML document
showModelessDialog() Displays a modeless dialog box that shows a specified HTML document


previous next

Jump to: Top of Page or HOME or Printer Friendly Printer friendly page


Search W3Schools:


What Others Say About Us

Does the world know about us? Check out these places:

Dogpile Alta Vista MSN Google Excite Lycos Yahoo Ask Jeeves


We Help You For Free. You Can Help Us!


W3Schools is for training only. We do not warrant its correctness or its fitness for use. The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.

Copyright 1999-2002 by Refsnes Data. All Rights Reserved


Validate How we converted to XHTML Validate

IISCart
ASP Ecommerce & Shopping Cart


Your own Web Site?

Read W3Schools
Hosting Tutorial



$15 Domain Name
Registration
Save $20 / year!



Advertise
at W3Schools

Only 0.5 CPM



SELECTED LINKS

University Online
Master Degree
Bachelor Degree


Web Software

The Future of
Web Development


Jobs and Careers

Web Security
Web Statistics
Web Standards


PARTNERS

W3Schools
TopXML
VisualBuilder
XMLPitstop
DevelopersDex
DevGuru
Programmers Heaven
The Code Project
Tek Tips Forum
ZVON.ORG
TopXML Search