The power of JavaScript is in the technologies that it can use. The browser actually makes
available various interfaces such as the window object, the XMLHttpRequest object, and the
document object. You??™ll learn more about the window object and the XMLHttpRequest object in
a little bit. Before that, let??™s talk about the DOM, which is what JavaScript uses to understand
and interact with the HTML document.
What Is the DOM?
The DOM is an application programming interface (API) that defines a set of objects along
with their properties and methods. The API was designed to be generic enough for both XML
and HTML.
CHAPTER 2 n HTML, CSS, AND JAVASCRIPT 25
The DOM is actually a number of different recommendations, and while I refer to them
as one big standard, there are actually three different recommendations with various components
to each. The DOM is broken down into DOM Level 0, 1, 2, and 3:
??? DOM Level 0 doesn??™t actually exist as a recommendation of the W3C. It is used to refer
to the features available in the third versions of both IE and Netscape.
??? DOM Level 1 consists of the core recommendation, which is meant for XML and HTML,
and also contains an HTML-specific extension. The extension also addresses the need
to be backward-compatible with the features of DOM Level 0. Many of these HTMLspecific
features share widespread and consistent browser support.
??? DOM Level 2 adds additional XML- and HTML-specific extensions and adds support
for manipulating style information, events, and ranges (handy for doing browser-based
WYSIWYG editing).
Pages:
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71