Book Image

Object-Oriented JavaScript

By : Stoyan Stefanov, Stoyan STEFANOV
Book Image

Object-Oriented JavaScript

By: Stoyan Stefanov, Stoyan STEFANOV

Overview of this book

Table of Contents (18 chapters)
Object-Oriented JavaScript
About the Author
About the Reviewers
Built-in Functions
Regular Expressions

BOM and DOM—An Overview

The JavaScript code in a page has access to a number of objects. These objects can be divided into:

  • Objects that have to do with the currently loaded page (the page is also called the document), and

  • Objects that deal with things outside the page (the browser window and the desktop screen)

The first collection of objects makes up the Document Object Model (DOM) and the second the Browser Object Model (BOM).

The DOM is a standard, governed by the World Wide Web Consortium (W3C) and has different versions, called levels, such as DOM Level 1, DOM Level 2, and—the last one so far—DOM Level 3. Modern browsers have different degrees of compliance with the standard, but in general, they almost all completely implement DOM Level 1. The DOM was standardized post-factum, after the browser vendors had each implemented their own ways to access the document. The legacy part (from before the W3C took over) is still around and is referred to as DOM 0, although no real DOM Level 0 standard...