|
|
window Object and
Pop-up Windows (Lesson 14)
In this last lesson we will talk briefly about the most top level
object in JavaScript hierarchy which of course is the window Object. The
section concerning pop-up windows is not complete yet but I do provied a
link to a page on my JavaScript Corral Site where you can learn how to do
Pop-up Windows. I also plan of doing a wrap up on this tutorial either in
this lesson or as a Lesson 15.
window
Object
Listed below are the properties and methods of the window object.
Note that an indication as to whether the property is settable or not is
provided. See the note at the end of the Properties table for an
explanation. An indication as to which browsers the properties and methods
work on is also given. If left blank, then that particular property or
method should work on all browsers that support JavaScript.
Property Summary for Window Object
|
closed |
Boolean, Specifies whether a window has been
closed. |
N3+, IE4+ |
defaultStatus |
String, Reflects the default message displayed in the
window's status bar. |
|
document |
Object, Contains information on the current document, and
provides methods for displaying HTML output to the
user. |
|
frames[] |
Window object, An array reflecting all the frames in a
window. |
|
history |
Object, Contains information on the URLs that the client
has visited within a window. |
|
innerHeight |
Integer, Specifies the vertical dimension, in pixels, of
the window's content area. |
N4+ only |
innerWidth |
Integer, Specifies the horizontal dimension, in pixels,
of the window's content area |
N4+ only |
length |
Interger, The number of frames in the window. |
|
location |
Object, Contains information on the current URL. |
|
locationbar |
Object, Represents the browser window's location
bar. |
|
menubar |
Object, Represents the browser window's menu
bar. |
|
name |
String, A unique name used to refer to this
window. |
|
opener |
Window object, Specifies the window name of the calling
document when a window is opened using the open method |
|
outerHeight |
Integer, Specifies the vertical dimension, in pixels, of
the window's outside boundary. |
N4+ only |
outerWidth |
Integer, Specifies the horizontal dimension, in pixels,
of the window's outside boundary. |
N4+ only |
pageXOffset |
Integer, Provides the current x-position, in pixels, of a
window's viewed page. |
N4+ only |
pageYOffset |
Integer, Provides the current y-position, in pixels, of a
window's viewed page |
N4+ only |
parent |
Window object, A synonym for a window or frame whose
frameset contains the current frame. |
|
personalbar |
Object, Represents the browser window's personal bar
(also called the directories bar). |
|
scrollbars |
Object, Represents the browser window's scroll bars.
|
|
self |
Window object, A synonym for the current
window. |
|
status |
String, Specifies a priority or transient message in the
window's status bar (This property is not readable.). |
|
statusbar |
Object, Represents the browser window's status
bar. |
|
toolbar |
Object, Represents the browser window's tool
bar. |
|
top |
Window object, A synonym for the topmost browser
window. |
|
window |
Window object, A synonym for the current
window. |
|
Bold
properties are settable and readable. All others are readable but not
settable. There is one exception. Status is settable but not readable.
Window objects (frames[], opener,
parent, self, top, and window) are unique objects that are used as a
synonym for a window.
Method Summary for Window
Object |
alert() |
Displays an Alert dialog box with a message and an OK
button. |
|
back() |
Undoes the last history step in any frame within the
top-level window. |
N4+ only |
blur() |
Removes focus from the specified object. |
N3+, IE4+ |
captureEvents() |
Sets the window or document to capture all events of the
specified type |
N4+ only |
clearInterval() |
Cancels a timeout that was set with the setInterval()
method |
N4+, IE4+ |
clearTimeout() |
Cancels a timeout that was set with the setTimeout
method. |
|
close() |
Closes the specified window. |
|
confirm() |
Displays a Confirm dialog box with specified message and
OK and Cancel buttons the |
|
disableExtermalCapture() |
Disables external event capturing set by the
enableExternalCapture method. |
N4+ only |
enableExtermalCapture() |
Allows a window with frames to capture events in pages
loaded from different locations(servers). |
N4+ only |
find() |
Finds the specified text string in the contents of the
specified window |
N4+ only |
focus() |
Gives focus to the specified object. |
N3+, IE4+ |
forward() |
Loads the next URL in the history list. |
N4+ only |
handleEvent() |
Invokes the handler for the specified event |
N4+ only |
home() |
Points the browser to the URL specified in preferences as
the user's home page. |
N4+ only |
moveBy() |
Moves the window by the specified amounts. |
N4+ only |
moveTo() |
Moves the top-left corner of the window to the specified
screen coordinates. |
N4+ only |
open() |
Opens a new web browser window. |
|
print() |
Prints the contents of the window or frame. |
N4+ only |
prompt() |
Displays a Prompt dialog box with a message and an input
field. |
|
releaseEvents() |
Sets the window to release captured events of the
specified type, sending the event to objects further along the
event hierarchy. |
N4+ only |
resizeBy() |
Resizes an entire window by moving the window's
bottom-right corner by the specified amount |
N4+ only |
resizeTo() |
Resizes an entire window to the specified outer height
and width. |
N4+ only |
routeEvent() |
Passes a captured event along the normal event
hierarchy. |
N4+ only |
scroll() |
Scrolls a window to a specified coordinate. |
N3+, IE4+ |
scrollBy() |
Scrolls the viewing area of a window by the specified
amount. |
N4+ only |
scrollTo() |
Scrolls the viewing area of the window to the specified
coordinates, such that the specified point becomes the top-left
corner. |
N4+ only |
setInterval() |
Evaluates an expression or calls a function every time a
specified number of milliseconds elapses. |
N4+, IE4+ |
setTimeout() |
Evaluates an expression or calls a function once after a
specified number of milliseconds has elapsed. |
|
stop() |
Stops the current download. |
N4+ only |
You can find out more about the these properties and methods by reading
the Netscape Guide on the Window object.
Pop-up
Windows
Sorry, I haven't written this portion of the class yet. However, you
can visit the Pop-up's section of my JavaScript Corral Site where you'll
find a tutorial on pop-up windows.
[ Top
of Page | Contents ]
|
|