Brad Neuberg recently spotted a programmer in a coffee shop hacking on a DHTML application. There have been quite a few DHTML sightings lately, making me believe that DHTML is finally coming of age.
Dynamic HTML is not a specific technology but rather a technique of creating rich internet applications by augmenting static HTML with client-side scripting and style definitions. In practice this is often done with HTML, JavaScript, and CSS.
There are various other frameworks for rich internet applications, such as Flex and Laszlo, but they have not gained popularity; perhaps this is because they rely on Flash as a 3rd party browser extension. Since DHTML relies only on Javascript and CSS, which are now both widely supported in modern browsers, DHTML should be clear for take off.
So what is the holdup? The biggest gotcha with using DHTML is having to wade through the qaugmire of browser incompatibilities in their support for Javascript and CSS. Javascript-based DOM methods in one browser might not have the same effect in another browser. Also, the lack of cross-browser CSS support creates a large amount of developer consternation.
Some folks are working to fix the mess. The open-source x library encapsulates all the DOM incompatibilities by creating a browser-independent javascript API for DOM manipulation. On the CSS front, Dean Edwards has taken the approach of “leveling the playing field”; his cheekily-named IE7 project is a complex layer that makes Internet Explorer behave in a CSS compliant way.
These kinds of grassroots efforts are typical with DHTML, because unlike Flex and Laszlo, DHTML has no standard libraries or toolkits. In fact, the community has been re-inventing DHTML tools for years without coming up a standard cross-browser DHTML solution.
Things have come a long way, however, and the frontiers are now being pushed with DHTML. Mihai Bazon of Dynarch, for example, has produced some really slick DHTML menus and other widgets; I even found myself right-clicking on them to convince myself that they were not actually coded in Flash.
DHTML seems to work best when applied lightly and transparently, avoiding the worries of rich internet applications. Some of the best uses of DHTML are when you don’t even realize that it is DHTML, such as Google’s GMail. I believe DHTML is least effective when used in an attempt to make a web application look like a desktop application.
With all these cool new techniques, DHTML can also bring a few annoying possibilities, such as DHTML pop-up ads. Many users have been switching to security conscious browsers and otherwise blocking ads that pop up in separate os-native windows, but DHTML pop-ups are a whole new way to get your attention. The first time I visited this Time Magazine story, I was barraged with two (annoying but harmless) DHTML pop-up ads.
As more DHTML libraries and widgets are released with open-source licenses, it seems more likely that DHTML will continue to gradually enrich web applications enough so that the adoption of a separate RIA framework like Flex or Laszlo might no longer be necessary.