DHTML uses those technologies to dynamically modify the rendering and content without either reloading the current page or loading a different page. The specifics of which technologies can be implemented depend on the requirements of your audience and cross-browser support. For example, if the client’s browser is Microsoft Internet Explorer, then VBScript, ActiveX, and data source objects can be included in the mix, but doing so means the loss of cross-browser support.
In this article, I will examine the main technologies behind DHTML and explain how they work together.
<input name="btnGet" type="button" value="Submit" />
By itself, it produces an HTML button. But add onmouseover and onmouseout event handlers, as show below, and the input button has gone from HTML to DHTML through the use of a simple mouse event:
Because of the ways that the various browsers implemented the World Wide Web Consortium’s Document Object Model Level 1 specification, the DOM is the weakest link in DHTML. Nevertheless, it represents a vast improvement over the past, when each browser did not consistently support DOM functionality. With care, you can now create pages without having to determine which browser the client is running—although for certain cross-browser applications, you still must check browsers. Listing A shows a DHTML page that works on Microsoft Internet Explorer 6.0, Mozilla, and Opera.