Introduction to AJAX

In the last six months there has been a lot of talk (read “hype”) about something people are calling “Web 2.0.” What they mean when they throw these buzzwords around is that there are some exciting new technologies that will transform the Internet into something we hoped it would be the first time around.

Whether or not this turns out to be true, the fact is that there are some interesting things being done with technology these days, and lucky for us – they include JavaScript! One of the foremost technologies being bandied about is something called AJAX, which is an acronym for “Asynchronous JavaScript + XML,” and it actually isn’t all that new. What is new is the way it is being used and the technologies with which it is being paired.

AJAX as a catchphrase was coined by Jesse James Garrett of Adaptive Path. With a company called 37 Signals, they have made some early use to bring these techniques to the forefront in the web development world. You can read a longer introduction to the concept written by Garrett himself if you like, but we will focus on the basics as an introduction coupled with JavaScript.

$2.79
- OR -

Overview

In a nutshell…

The key element that is giving everyone the heebie-jeebies is the term “asynchronous”  - in other words we’re going to make a round trip to the server, without actually going there! We’re all used to the normal browser behaviour where a user takes an action, the browser makes an HTTP request to the server, then the server sends a response back.

While it all works just wonderfully, sometimes the results leave a bit to be desired. What AJAX will allow us to do is make a request to the server asynchronously – without making that round trip. It will be done in the background, with our pal JavaScript doing most of the heavy lifting and some simple PHP on the server side doing the rest of the work.

In order for you to get a feel for what we are talking about here, take a good look at Google Suggest. This is Google – on steroids. And on AJAX, too. Type in a search term and you will see a box come up with a list of the top results for what you have entered into the search box. Every time you type another character the suggest box updates itself – all without reloading the page. It all happens asynchronously – in the background if you will. You get the same concept with Google Maps. You are able to move the map around and it essentially updates in real time. If you are interested, there are lots of working examples on the web.

Reviews

Be the first to write a review

You must me logged in to write a review.