Today we will give a high level overview of Ajax. Ajax stands for Asynchronous JavaScript And XML. What it allows you to do is by utilizing JavaScript you can update parts of a webpage without having to reload the entire page. Once you know what Ajax is, you will find that you see it being used all over the internet.
Ajax is achieved by using the XMLHTTPRequest Object in JavaScript. While the XML in the XMLHTTPRequest Object and the X acronym, you rarely will find that you will use XML in your requests. You will mostly find yourself using plain text or HTML and doing something with that data.
In general, the following technologies are all used in Ajax. Most of which you already you should already be accustomed to using.
- XHTML and CSS – Obviously this is the information for how your page looks
- The Document Object Model or DOM – This is how you identify the different parts of your HTML document. This is especially important since you will have to be able to select which parts of your page needs to be updated.
- XML and XSLT – This is used for the interchange and manipulation and display of data.
- XMLHTTPRequest Object – This is what will actually make the call out to the webserver and retrieve the information. Very important part of the process!
- JavaScript – The programming language that will use all of the technologies together to give you your Ajax web application
While I have a great appreciation of Ajax, I feel strongly that it should only be used in cases where it is necessary. Having Ajax all over the place can make your website looks really cool to others, but having too much of it can cause some interesting issues for your site and your users. Most notably, the fact that search engine crawlers are not entirely able to get the information from Ajax requests, they will never get that data (Do you really want Google to see your entire site as one or two pages?). Some people may find this “con” to actually be a “pro” and will sometimes hide information they do not want crawlers to see by using Ajax. While technically true, I feel that being deceitful toward the search engines is wrong and should be avoided.
Some people also think that overuse of Ajax will bring your server to a crawl because of the additional requests your server will have to handle. Your mileage may vary on that because you may only have to refresh only part of a page, rather than the entire page. It just depends on what your site does.
Now that you have a very very general description of what Ajax is, you are probably wondering why I have not mentioned jQuery at all. One of the principal features of jQuery is its built in Ajax wrapper. With jQuery you can use Ajax with great ease than creating your own implementation of Ajax. Since jQuery is tested on all major browser platforms you can rest assured that your Ajax will fire off on IE, Firefox, Safari, and Opera. Knowing this information takes a tremendous burden off your shoulders (as well as allows you to write much less code).
For the rest of the week, we will discuss some of the ways that you can use Ajax to improve your web application. I hope you will check back this week or subscribe to the RSS or via email on the right side bar.
Thanks to Wikipedia for giving some of the finer details of Ajax.





