The browser provides us with a hierarchy of objects which we can use to control and access various information about time, screen, page, elements on a page etc.
BOM is a pack of objects that allow to control the browser, e.g change current URL, access frames, do background requests to server with XMLHttpRequest etc. Functions like alert,confirm,prompt also belong BOM, they are provided by the browser.
- history object.
- window object .
- navigator object.
- document object .
- location object.
- screen object.
history object :
The history object tracks what pages the user has visited in the current browser session. It is stored as a data stack that allows the user to use the Back and Forward buttons to move through the stack.
|forward()||To go one step forward in the history|
|back()||loads the previous page.|
|length||To return the items in the browser history|
|go()||loads the given page number|
window Object :
The window object represents the browser's frame or window, in which window is created automatically .
|confirm()||displays the confirm dialog box containing message with ok and cancel button|
|alert()||displays the alert box containing message with ok button.|
|prompt()||displays a dialog box to get input from the user.|
|close()||its closes the current window.|
|open()||its opens the new window.|
|appName||The name of the Browser.|
|appVersion||Specifies the Version of the Browser.|
|appCodeName||The Code name of the Browser.|
|platform||The HTTP user-agent header sent from the browser to the server.|
|userAgent||eturns the plugins. It is supported in Netscape and Firefox only.|
|cookieEnabled||its returns true if cookie is enabled otherwise false|
|plugins||its returns the plugins. It is supported in Netscape and Firefox only.|
|mimeTypes||Array of MIME types registered with the browser.|