Skip to Content
Web Design in a Nutshell, 3rd Edition
book

Web Design in a Nutshell, 3rd Edition

by Jennifer Robbins
February 2006
Intermediate to advanced
826 pages
63h 42m
English
O'Reilly Media, Inc.
Content preview from Web Design in a Nutshell, 3rd Edition

The Browser Object

Finally, you should at least briefly consider the Browser Object Model or Browser Object. Using JavaScript, you can not only read and control the page and its contents, but also read and adjust properties of the browser displaying it. This can be in the form of resizing the window, or simply getting the value of the URI displayed in the address bar. Table 26-6 summarizes a few of the common properties and methods available to you in the Browser Object, which is accessed programmatically as window.

Table 26-6. Browser Object properties and methods

Property/method

Description

event

Represents the state of an event

history

Contains the URLs the user has visited within a browser window

location

Gives read/write access to the URI in the address bar

opener

Sets or returns a reference to the window that created the window

parent

Returns the parent window

screenLeft

Returns the x-coordinate of the upper-left corner of the browser relative to the upper-left corner of the screen

screenTop

Returns the y-coordinate of the top corner of the browser relative to the top corner of the screen

status

Sets or returns the text in the status bar of the window

alert( )

Displays an alert box with a specified message and an OK button

close( )

Closes the current window

confirm( )

Displays a dialog box with a specified message and an OK and a Cancel button

focus( )

Sets focus on the current window

open( )

Opens a new browser window

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Responsive Web Design with HTML5 and CSS3

Beginning Responsive Web Design with HTML5 and CSS3

Jonathan Fielding

Publisher Resources

ISBN: 0596009879Errata Page