Window Object Terms

[ Window Object ]

A window object represents an open window in a browser, and holds all parts of the web page. Global Javascript variables, objects, and functions become part of the window object, with global variables being properties and global functions being methods. The window object includes many properties, including "innerHeight" and "innerWidth" which control the height and width of the browser window. Other objects, such as the Navigator, Location, Screen, History, and Document objects can be returned within the window object.

[ Navigator Object ]

The navigator object holds information about the browser that is being used. Properties of the navigator object include “geolocation”, which can be used to find the browser users' location, "onLine", which finds if the browser is online or not, and "cookieEnabled", which finds if cookies are enabled in the browser.

[ Location Object ]

The location object contains information about the current URL being accessed. Some of the properties it includes are "href", which returns or sets the URL in its entirety, "pathname", which returns or sets the path name, and "search", which returns the querystring (the part of the URL after the "?") and is usually used for parameter passing.

[ Screen Object ]

The screen object contains information about the physical screen that the visitor to the browser window is using. This object contains information like the height, width and pixel Depth of the visitor’s screen.

[ History Object ]

The history object holds the URLs visited by the user in the browser window. This object is used in the "back" and "forward" functions of the browse, as well as allowing for going to a specific past URL, and discovering the amount of previous URLs visited.

[ Document Object ]

The history object holds the URLs visited by the user in the browser window. This object is used in the “back” and “forward” functions of the browse, as well as allowing for going to a specific past URL, and discovering the amount of previous URLs visited.