Main Page

The Browser Object Model (BOM)

The Browser Object Model (BOM)
The Internet Explorer 3.0 and Netscape Navigator 3.0 browsers feature a
Browser Object Model
(BOM)
that allows access and manipulation of the browser window. Using the BOM, developers can move the
window, change text in the status bar, and perform other actions that do not directly relate to the page
content. What makes the BOM truly unique, and often problematic, is that it is the only part of a
JavaScript implementation that has no related standard.
Primarily, the BOM deals with the browser window and frames, but generally any browser-specific
extension to JavaScript is considered to be a part of the BOM. Such things include:
?
The capability to pop up new browser windows.
?
The capability to move, resize, and close browser windows.
?
The navigator object, which provides detailed information about the Web browser.
?
The location object, which gives detailed information about the page loaded in the browser.
?
The screen object, which gives detailed information about the user ’s screen resolution.
?
Support for cookies.
?
Internet Explorer extends the BOM to include the ActiveXObject class, which can be used to
instantiate ActiveX objects through JavaScript.
Because no standards exist for the BOM, each browser has its own implementation. There are some
de
facto
standards, such as having a window object and a navigator object, but each browser defines its own
properties and methods for these and other objects. Chapter 5, “JavaScript in the Browser,” goes into
more detail about the implementation differences.
Summary
This chapter introduced JavaScript as a client-side scripting language for Web browsers. You learned
about the various parts that make up a complete JavaScript implementation:
?
ECMAScript, the core of JavaScript, describes the language syntax and basic objects.
?
The Document Object Model (DOM) describes methods and interfaces for working with the
content of a Web page.
?
The Browser Object Model (BOM) describes methods and interfaces for interacting with the
browser.
Additionally, you explored the history of JavaScript to gain an understanding of how various parts of
the language developed and how browsers historically have dealt with the implementation of standards.
9
What Is JavaScript?
04_579088 ch01.qxd 3/28/05 11:34 AM Page 9


JavaScript EditorFree JavaScript Editor     Ajax Editor


©

R7