My first use of XMLHttpRequest (or AJAX, as it was commonly called in 2005) was with the same Precious Metals Calculator I've already written about. Before XMLHttpRequest, I gathered the data for the Precious Metals Calculator using server-side technology, reading the current metals price from a daily email I received. While this method was reliable, it was accurate only once a day. I longed for a system that was up-to-the-minute. I finally achieved that when I could start reading the Yahoo website via XMLHttpRequest and giving the visitors the current value in real time.
The ability to access the DOM was the point at which I could start moving away from the server-side entirely. I had previously been saddled with having to use technologies like Active Server Pages (ASP) or ColdFusion to control the user interface, but I quickly found that I barely needed to deal with the server-side at all, except for security and SQL database access. Practically everything else could now be done completely in the browser.
But I wasn't just building a web analogue to a paper-based report. They had some strict requirements for it. They needed the ability to compare information that was contained in different parts of the report. They needed to interactively sort the information based on any column of the section. They needed to drill down into any row of the section. They needed to limit the users' ability to print the data on paper. I was able to accomplish all these things in my proof-of-concept.
They liked my concept so much that they wanted me to do the project for real. I didn't expect that. To simplify things, the first thing I decided to do was create what looked like a six-page website out of a single page. I was able to accomplish this by creating it on the fly via a JSON with all the data (created by the back-end Java program already in use). Just like every large project I've ever tackled, it required that I learn some new things ~~ in this case, it was learning how to create and delete nodes, as well as finding out the intricacies of JSON creation on the fly.