Net-informations.com
SiteMap  | About    

Browser Object Model

The Browser Object Model (BOM) is a browser-specific convention referring to all the objects exposed by the web browser. When the browser parses a document, it creates a collection of objects that define the document and detail how it should be displayed. The object that the browser creates is known as the Document Object . It is part of a larger collection of objects that the browser makes use of. This collection of browser objects is collectively known as the Browser Object Model, or BOM. BOM is not standardized by ECMAScript , though it is described as core part of JavaScript. The important BOM objects are as:

  1. document
  2. location
  3. history
  4. navigator
  5. screen
  6. frames

There is a hierarchy of browser objects that are used to manipulate methods and properties associated with the Web browser itself. The top level object in the BOM is the window object. The window object represents the browser window. All other browser objects are contained within the window object. The window object includes a number of properties and methods that can be used to control the Web browser. A good portion of client-side Web develop is in working with the properties and methods associated with the browser itself, with its windows, and with the documents that occupy them.

The browser's window is represented by a global object called window object. The Window object is supported by all the major browsers and contains all the global JavaScript objects. Any function, object or variable in JavaScript becomes a member of the Window Object. Few examples of window object properties and methods as follows:

The Document element which is root of DOM elements are part of BOM in object hierarchy. The Document object represents the Web page displayed in the browser. All elements on a Web page including HTML tags are contained within the document object. Since the document object is often considered the most important part of the BOM, it is represented by its own object model called the Document Object Model or DOM . Unlike the Document Object Model, there is no standard for implementation and no strict definition, so browser vendors are free to implement the BOM in any way they wish. All global objects, functions, variables of JavaScript are members of Window object by default. JavaScript allows window reference to be omitted while accessing most of its elements. Examples of Global objects as follows:

The example shown in the above two statements means the same.

BOM example









net-informations.com (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.