XMLHTTPRequest
I have now spent a bit of time playing around with AJAX using it in a few of my web applications. Essentially AJAX boils down to one thing: The XMLHTTPRequest Object. Some people will probably disagree with me on that point but all the fancy JavaScript is just that, it is not very novel by itself. The ability to bring new information to a page that already exists on the client side without having to reload the whole page is something I find amazing.
It is certainly possible to overdo it when using a technology such as this and so I will give, as an example, an application with a good need for it. Generally the new information that you are going to load into the current webpage will be collected from a database. The primary page that the client will load is a simple query with many records but not much detail. The point of this is to reduce the load on the database server and improve the responsiveness of the page. Now the detailed information for each record can be loaded on demand based on the users actions, such as clicking a certain record.
You might be thinking: “What is the point of that? Just have the click go to another page with the rest of the information or use a popup.” Both of these options are possible of course and have been used many times successfully in the past. What we want to do is set our site apart from the rest, not blend in. By using XMLHTTPRequest and some simple JavaScript we can generate a new fly-out section accessible via some visual cue beside each record. These fly-outs start empty and are filled by JavaScript when the data is returned. Done correctly the user will never notice that the information is being loaded on the fly and will be impressed by the dynamic nature of your site. The bonus to us is that the amount of bandwidth generated by our web application is reduced.
Google has an amazing suite of very novel applications that use XMLHTTPRequest to make the user experience that much more impressive: Google Suggest, Google Maps and GMail (if you don’t have a GMail account let me know and I can invite you). I am now a firm believer in more functional web applications as I believe that web based (platform independent) applications are a much better idea requiring less work for system administrators.