inset
Dynamic HTML Rides Again
Apr. 25, 2005

Browser technologies originally developed by Microsoft have a new lease on life thanks in part to their adoption by Google. Known to Microsoft as Dynamic HTML, the so-called Ajax technologies can help developers build sophisticated Web user interfaces without relying on products such as Macromedia's Flash. Ajax has emerged as a competitor to Microsoft's preferred methods of client software development, but developers using Microsoft's ASP.NET Web development platform could benefit from the technology.

Out of DHTML Comes Ajax

Ajax is shorthand for "Asynchronous JavaScript and XML." Ajax applications are Web pages that incorporate JavaScript (or Microsoft's JScript variant), display data to the user via HTML and Cascading Style Sheets (CSS), and retrieve data to display from a Web server in XML form. The key difference between an Ajax application and a typical Web page that uses JavaScript is that the Ajax application retrieves XML data asynchronously—that is, in the background, while the user is performing other tasks.

Google Maps, for example, displays new portions of a map when the user drags the cursor in the map window. Mapping sites that do not use Ajax do not provide the same interactivity. Expedia Maps, MapQuest, and Yahoo Maps, for example, must download a new map each time the user clicks an arrow, making the user wait while the whole Web page refreshes.

By making Web applications more attractive, Ajax competes with Microsoft's technologies for "smart client" user interfaces, including Windows Forms, Office "smart documents," and the planned "Avalon" forms technology. Ironically, key parts of Ajax were originally developed by Microsoft. Internet Explorer (IE) 5 introduced an API known as XMLHttpRequest, which allowed the browser to asynchronously download XML data. But Microsoft was unable to convince major Web developers to use the API because it was only available in IE, and only in the most recent versions. Microsoft has subsequently downplayed DHTML in place of its smart client architecture, which strongly favors its Windows OS and Visual Studio developer tools.

However, support for asynchronous XML has become more widespread as users have moved to newer versions of IE and support for asynchronous XML was added to non-Microsoft browsers, such as Mozilla Firefox and Apple's Safari. The combination has led to renewed interest on the part of Web developers such as Google.

Alternative to Flash, Opportunity for ASP.NET

For developers, Ajax provides a way of building interactive Web applications without relying on technologies that require a special browser plug-in, such as Macromedia's Flash. However, Ajax has its limits. The display may pause momentarily while data is retrieved. In addition, although most desktop PC browsers now support asynchronous XML, the APIs for the function are not standardized across browsers, and support is not widely available on mobile devices. Consequently, Web developers must still detect the capabilities of the browser.

ASP.NET, Microsoft's Web development platform, already detects browser capabilities and, in some cases, will generate client-side JavaScript to give users a more polished interface. Future versions of ASP.NET could help developers take advantage of Ajax technologies by generating the necessary JavaScript automatically. However, Microsoft has not announced any plans to do so.

Resources

A description of Ajax by the consultant who coined the term is at www.adaptivepath.com/publications/essays/archives/000385.php.

DHTML is described at msdn.microsoft.com/workshop/author/dhtml/dhtml.asp.

XMLHttpRequest implementations by various browsers are described at developer.apple.com/internet/webcontent/xmlhttpreq.html.

Microsoft's documentation for XMLHttpRequest is at msdn.microsoft.com/library/en-us/xmlsdk/html/xmobjxmlhttprequest.asp.