These interactive technologies were created or added in an attempt to overcome what were considered to be the chief limitations of Web pages designed with static HTML. Although the Web was great for delivering pages of text and graphics, they lacked the interactivity needed to create robust Web-based applications or deliver media beyond text. Those who were used to multimedia were left wanting more.
Adding DHTML to your Web site means that your pages can act and react to the user without continually returning to the Web server for more data. In programming terms, placing all of the code in the Web page is called client-side code. For you, it means not having to learn server-side programming to create interactive Web sites (see the sidebar "What DHTML Should Be").
DHTML is a combination of different standards-based Web technologies that, when used together, allow greater interactivity on your Web page (Figure 11.2).
Figure 11.2. The components of DHTML.
Cascading Style Sheets (CSS)
CSS allows you to define the style properties of any element on the page. Earlier browsers (such as Netscape Navigator 4 and Microsoft Internet Explorer 4) supported CSS Level 1 and CSS-P; most modern browsers support CSS Level 2.1. CSS is a standard defined by the World Wide Web Consortium (W3C). For more details on CSS, see Chapter 1.
Document Object Model (DOM)
All DHTML-capable browsers have some version of the DOM that you can use to access the properties of any element-turned-object in the browser window. The problem is that the W3C did not standardize the DOM until 1998, and earlier browsers (Netscape Navigator 4 and Microsoft Internet Explorer 4) implemented their own conflicting DOMs. The good news is that the majority of modern browsers now support the W3C DOM, and legacy coding is becoming increasingly unnecessary, unless backward compatibility is required. For more details on the DOM, see Chapter 12.
Figure 11.3. ECMA International's ECMAScript Web page (ecma-international.org/publications/standards/Ecma-262.htm).
XHTML (Extensible Hypertext Markup Language) is a hybrid of XML and HTML that is gradually replacing HTML in common use (see Figure 11.4). Although DHTML can be applied to a wide variety of markup languages, in this book we'll be coding using the XHTML standard.
Figure 11.4. The W3C's HyperText Markup Language Web page (w3.org/MarkUp/).