AJAX - A blending of technologies
AJAX
AJAX isn't a new technology. In fact, it's neither new or a single technology - the capability has been a part of the JavaScript language for years on the client side, and server side even longer.
Asynchronous Javascript And XML, or AJAX, is simply a means of sending a query to a web server, and asking it to return data. Very similar to a page request (clicking a link to a new page on a web site), you ask, and the server gives it to you.
Where AJAX differs is in the timing and the result. At any point, an AJAX request can be sent from the current page, and the server will return data to the current page. Then, the Javascript on the page accepts the data coming from the server and places something on the page - either a status message, an updated image, or an entire HTML block of code.
Some applications of AJAX, being used in the real world:
- Google Maps - when the map is scrolled, the page detects if it needs to download a new map square, and asks the server for it on the fly. The image is returned from the server, the Javascript drops it into the proper position, and the map keeps scrolling.
- Stock Tickers - a message is sent from a client (your web browser) to a stock exchange server, which can send a current value message back and the ticker on the page is updated in real-time.
- Amazon's API - I can pass a series of keywords to a 'hook' provided by Amazon, which will return an XML document containing a list of books, videos, CDs or whatever. I can then take that list, pretty it up in Javascript, and place it into my page. Clicking a link will take you to Amazon, but will tell them you came from my site.
These are pretty trivial and quick examples of what AJAX can do. There are almost limitless possibilities for uses, more emerging every day.
I've got a few AJAX-related projects in the works. Be watching this space for news of them as they come live!