BOM or Browser Object Model is a collection of methods and properties implemented by browser. It is frequently represented by a Window object, but it describes also other objects which used to be proprietary but are now considered practically a standard.
BOM objects
| OBJECT |
DESCRIPTION |
|---|
| history |
Collects the list web pages that a user has navigated. |
| location |
Returns the information and navigation functionality of the currently loaded page. |
| navigator |
Gathers user's browser object information. |
| window |
Special function objects acting as arrays. |
BOM methods
| METHOD |
OBJECT |
DESCRIPTION |
|---|
| alert() |
window |
A system dialog pop-up messages used to alert users of potential incorrect actions. |
| assign() |
location |
Changes current URL to a new one. |
| back() |
history |
Shows the previous URL (if any in history list). |
| confirm() |
window |
A system dialog pop-up messages used to let users confirm or cancel prompted actions. |
| clearInterval() |
window |
Terminates execution of the timer set by setInterval(). |
| clearTimeout() |
window |
Terminates execution of the timer set by setTimeout(). |
| forward() |
history |
Shows the next URL (if any in history list). |
| go() |
history |
Shows a specific (given) URL (if any in history list). |
| open() |
window |
Opens a new window in the browser after being triggered by an event. |
| prompt() |
window |
A system dialog pop-up messages used to allow users enter data in same manner as they do with form fields. |
| reload() |
location |
Reloads the same document. |
| replace() |
location |
Replaces the current page with a new one. |
| setInterval() |
window |
Executes a function that is passed to it, in specified millisecond based intervals. |
| setTimeout() |
window |
Executes a function that is passed to it after set millisecond based time has elapsed. |
BOM properties
| PROPERTY |
OBJECT |
DESCRIPTION |
|---|
| appName (appCodeName) |
navigator |
Returns name of the browser. |
| appVersion (userAgent) |
navigator |
Returns version of the browser. |
| cookieEnabled |
navigator |
Checks if cookies are enabled. |
| hash |
location |
Returns or sets the hash (#) part of the anchor part of the URL. |
| host |
location |
Returns or sets the host name and port number of the URL. |
| hostname |
location |
Returns or sets the hostname of the URL. |
| href |
location |
Returns or sets the complete URL. |
| innerHeight (clientHeight) |
window |
Determines the document area's height of a window. |
| innerWidth (clientWidth) |
window |
Determines the document area's width of a window. |
| javaEnabled() |
navigator |
Checks if Java is enabled. |
| language |
navigator |
Checks browser's language. |
| length |
window, history |
Returns the number of items under history object or elements under window object. |
| origin |
location |
Returns the protocol, hostname and port number of the URL. |
| outerHeight |
window |
Determines the document area's height of a window, inclusing toolbars and scrollbars. |
| outerWidth |
window |
Determines the document area's width of a window, inclusing toolbars and scrollbars. |
| pathname |
location |
Returns or sets the path name of the URL. |
| platform |
navigator |
Returns OS where browser is installed. |
| plugins (with sub-properties) |
navigator |
Returns an array of plug-ins installed in the browser. |
| port |
location |
Returns or sets the port number of the URL. |
| product |
navigator |
Returns engine of the browser |
| protocol |
location |
Returns or sets the protocol of the URL. |
| search |
location |
Returns or sets a query string of the URL (or part of it). |
| screenX (screenLeft) |
window |
Determines X-axis position of a window with the respect to the viewport. |
| screenY (screenTop) |
window |
Determines Y-axis position of a window with the respect to the viewport. |
| userAgent (appVersion) |
navigator |
Returns version of the browser. |
Comments
No comments have been made yet.
Please login to leave a comment. Login now