Since I’ve made the jump into CakePHP, I’ve begun using the Prototype javascript libraries. If you’re a Javascript programmer, and have never used prototype.js, you’re in for a real treat. It handles a lot of your cross-browser issues, and gives a really cool API for building Web 2.0 applications.
Anyways, prototype has a real nice function called Ajax.Updater, which makes a call to your server and replaces an element with the returned html. It makes creating an ajaxy application really nice. But is this really AJAX? Or is it AJAH?
AJAX stands for Asynchronous JavaScript And XML. So I came up with the term AJAH, which stands for Asynchronous JavaScript And HTML. Okay, I know that HTML is a flavor of XML, so technically you can say that it AJAH is AJAX, but I still think there is a difference.
XML is primarily a markup that allows you to send data formatted in such a way computers can read and interpret the data. The data can be extracted at a granular level. With HTML, the elements of data that you are passing are usually not extract-able unless you use micro-formatting.
With true AJAX, a call is made to the server, the nicely formatted data is returned and the client application extracts the data from the xml, and replaces whatever elements need to be replaced on a page. With AJAH, a glob of html is returned and slapped into the page.
So, which is better? I’m not sure at this point. AJAH definitely allows you to create a dynamic site that can talk to the server behind the scenes quickly and easily so I’m fine using AJAH.
Also, I’m working on a CakePHP/Frameworks post… Stay tuned.