For all of its perceived newness and sexiness, the technologies that make up Ajax are really not new. The ability to communicate back to the server through a hidden frame without posting the main page back to the server has been around for a long time. Communication between client and server has been available—back to the release of Internet Explorer’s ability to script ActiveX controls on the client browser and to the MSXML component, both of which date back into the late 1990s. Personally, I saw the first formal usage of client script and MSXML in 2003. The problem with the technology at that time was the need to manually create the necessary client-side JavaScript. In 2003, there was too much code overall that had to be written and too much custom code that had to be written to get this to work. It has been only in the second half of 2005 that client-side libraries and server-side support for ASP.NET have started to make their presence felt and been used significantly. The mainstream development community has only recently started using the technique. The release of Google’s Suggest and Maps are what really opened the eyes of the users to the development technologies. These applications sent a shockwave through the development community.
Technologies That Make Up Ajax
Ajax is a general umbrella term. As mentioned earlier, Ajax itself stands for Asynchronous JavaScript And XML. The term Ajax was actually coined by Jesse James Garret of Adaptive Path in an essay that was published in February 2005 (www.adaptivepath.com/publications/essays/archives/000385.php) and was quickly accepted by the development community.Based on this general umbrella term, take a look at the specific items that make up Ajax:
❑ XmlHttpRequest—XmlHttpRequest allows the browser to communicate to a back-end server.
This object allows the browser to talk to the server without requiring a postback of the entire
web page. With Internet Explorer, this capability is provided by the MSXML ActiveX component. With the Mozilla Firefox and other web browsers, this capability is provided by an object literally called XmlHttpRequest. The XmlHttpRequest object is modeled after the MSXML component. The client-side JavaScript libraries hide the differences between the various browser environments. Sometimes these communications are done through a hidden FRAME or IFRAME.
❑ JavaScript—JavaScript provides the capabilities to communicate with the back-end server.
The JavaScript must be version 1.5 or later. Although JavaScript is not specifically required, it
is needed from the standpoint that JavaScript is the only client-side scripting environment supported across the major modern web browsers. There are other client script languages; however, these are not supported across all browsers.
❑ DHTML/DOM support—The browser must support the ability to dynamically update form
elements, and the ability to do this in a standard way comes through the support for the
Document Object Model (DOM). By supporting the DOM, it becomes easy for developers to
write a single piece of code that targets multiple browsers.
❑ Data transport with XML or JSON—Using XML allows for the ability to communicate with
the web server in a standard mechanism. There are situations where the JavaScript Object
Notation (JSON) is used as the communication notation instead of straight XML.
Running Ajax Applications
Unfortunately, not all web browsers ever produced will support Ajax. To run Ajax, a web browser must:
❑ Be relatively modern. Ajax style applications are not available in all versions of all web browsers. Whereas Internet Explorer version 6, Firefox version 1.5, and Opera 8.5 provide support for these applications, older versions may be problematic because of their support for different versions of the other requirements.
❑ Support DOM.
❑ Utilize JavaScript.
❑ Support Extensible Markup Language (XML) and Extensible Style Language Transformation
(XSLT).
❑ Possibly have ActiveX enabled on the client. If you are using the Internet Explorer browser
while running on Windows, you may have problems if ActiveX is not enabled.