What is DHTML?
Dynamic HTML is not really a new specification of HTML, but rather a new way of looking at and controlling the standard HTML codes and commands.
When thinking of dynamic HTML, you need to remember the qualities of standard HTML, especially that once a page is loaded from the server, it will not change until another request comes to the server. Dynamic HTML give you more control over the HTML elements and allows them to change at any time, without returning to the Web server.
There are two main parts to DHTML:
- Document Object Model (DOM)
- Scripts
DOM
The DOM is what allows you to access any part of your Web page to change it with DHTML. Every part of a Web page is specified by the DOM and using its consistent naming conventions you can access them and change their properties.
Scripts
Scripts written in either JavaScript or VBScript are the two most common scripting languages used to activate DHTML. You use a scripting language to control the objects specified in the DOM.
Features of DHTML
There are four primary features of DHTML:
- Changing the tags and properties
- Real-time positioning
- Dynamic fonts (Netscape Communicator)
- Data binding (Internet Explorer)
Changing the tags and properties
This is one of the most common uses of DHTML. It allows you to change the qualities of an HTML tag depending on an event outside of the browser (such as a mouse click, time, or date, and so on). You can use this to preload information onto a page, and not display it unless the reader clicks on a specific link.
Cascading Style Sheets allow you to change many aspects of the look and feel of a Web page. DHTML allows you to call out styles and convert the look of your pages dynamically.
Real-time postioning
When most people think of DHTML this is what they expect. Objects, images, and text moving around the Web page. This can allow you to play interactive games with your readers or animate portions of your screen.
CSS positioning is the primary method that DHTML uses to locate elements on the page.
Dynamic Fonts
This is a Netscape only feature. Netscape developed this to get around the problem designers had with not knowing what fonts would be on a reader's system. With dynamic fonts, the fonts are encoded and downloaded with the page, so that the page always looks how the designer intended it to.
Data binding
This is an IE only feature. Microsoft developed this to allow easier access to databases from Web sites. It is very similar to using a CGI to access a database, but uses an ActiveX control to function. This feature is very advanced and difficult to use for the beginning DHTML writer.
First Page: Tips and Tricks > 1, 2

