The BOM (Browser Object Model)

By: Dusty Arlia
Published on Friday, July 5, 2013, 09:22 PM
Last Updated on Sunday, July 05, 2015 at 8:56 PM
Total Updates: 3

The Browser Object Model (BOM) defines a collection of objects. These objects include:

  • document - To work with webpages.
  • history - To work with a visitor's browser history.
  • navigator - To get information about the visitor's web browser.
  • window - The window object represents an entire browser window. It is the sole object at the top of the browser object model. Since the window object is the only object at the top of the BOM, you don’t need to explicitly reference it. Whenever a function, object, or collection is referenced, the interpreter always looks to the window object. If a page uses framesets, each frame is represented by its own window object and stored in the frames collection (inside the window) object.
  • …and more

These objects allow web developers to interact with visitor's web browsers and define the documents rendered within the browser window. The BOM allows you to detect things from your website visitors and react to events that occur. Here are some things you can do with the BOM:

  • React to events
  • Create windows
  • Resize windows
  • Get information about the visitor's browser and browser settings using the navigation object
  • Look through the visitor's browser history using the history object
  • Interact with webpages using the document object

The BOM might have some cross-browser issues, because each browser implements the BOM in its own way. That is why it is always a good idea to do cross-browser tesing.

One component of the BOM is the DOM (document object model).

Comments:

Ad: