What is AJAX?
- By: chrisgarrett [privmsg - website] On 30th Aug 2005
Lately there has been a lot of talk about this thing called "AJAX" and how it is the new big thing in web development etc etc. In this post I aim to give you a bit of background so next time it is mentioned you will know what the hell they are talking about.
So what is AJAX?
First of all AJAX is not a new technology, neither is it a single technology.
AJAX is a term to describe using Javascript to talk to a server without refreshing the web page.
The term AJAX stands for "Asynchronous JavaScript and XML". It actually does not need to be Javascript or XML to do the job but this is what the term stands for. (Adaptive Path who invented the term have certainly gotten some great publicity out of it though so good on them :O) )
The name is new, the approach isn't.
It's not new?
With all the excitement about AJAX you could be forgiven for thinking this is a new thing but it's not really that new, more that browser useage and bandwidth has caught up with the technologies.
Some would say that Microsoft laid the foundation when they created a system that allowed Internet Explorer to communicate using XML (XMLHTTP). The Outlook team built their web browser based version of their email interface using this back in 1998. The big pant-wetting excitement came with the raft of Google applications such as Gmail and Google Suggest. Personally I think Flickr has one of the nicest understated implementations.
So what is it good for?
Think Google maps or Flickr. You change some info and click buttons and things happen on screen right away. Rather than the page reloading with the new information it simply appears (after a much shorter delay than a page refresh). The experience is much more "application-like" than a normal web application experience.
So why isn't everyone doing it?
Sounds good doesn't it? Problem is there are a heck of a lot of people who still can not use AJAX sites so do not think it is majorly mainstream yet.
As well as browser adoption there is the problem all web developers face at some time and that is cross-browser compatibility. Accessibility and usability can be a problem, certainly to the point where it is not just screen readers that have trouble working out what is going on.
Then add in the fact you are giving the client a lot of trust to talk to your data (security professionals will often advise you to never trust the client end of a client-server equation).
Taking into account all this plus programming complexity, it is not always clear what the benefit of using AJAX as apposed to flash, activex or even standard web applications are.
Bottom line?
For those who can consume these AJAX applications the user experience can be great but right now we are talking about the icing on the cake rather than world-changing technology in my opinion.
What's your take?

pretty cool stuff
If you don't already read it this guy http://savas.parastatidis.name has some stuff you'll like Chris, half of it is right over my head but the bits I do sort of understand are things that make me start thinking "oooh - we could do that then?
I know from experience that if you can write a site without unwieldy refreshes it's so much nicer, if AJAX means that we can do that without jumping through the hoops we have to now (I listen to programmers swear all day about stuff like this) it will get really popular really quickly.
As far as security goes - well yeah, it'll give people like us nightmares, but actually clients don't care. Really. If they want their site to do something their competitors already does you can point out problems until you're blue in the face and at the end 90% will tell you to do it anyway.
Jumping through hoops
Unfortunately you still need to jump through hoops, just with a funkier new name ;O)
I take your point on clients not caring but in my experience when the proverbial hits the fan they start to care pretty quickly and start looking round for someone to blame!
Cornflakes
Accompanied by a late night bowl of cornflakes, that made for good reading chris, but you've left me with more questions than answers dammit! :)
doesn't have to be
OK! So, can this be done with other technologies, or are you talking about flash etc? I can't think of another client-side tech that could replace JS in this equation?
I did not know I knew that
I did not know that's what AJAX is, but I've been using the technique.
I used AJAX building a referee scheduling system http://www.myrefereeschedule.com
I used PHP on the server, JS in the browser. It gives the web application the feel of a desktop app.
It is not difficult once you do the first one or two pages. Debugging is a bit different, but not that bad.
Heh
Could be VBScript :O)
this is a great explanation.
this is a great explanation. thanks.
AJAX Guises
Could be VBScript, true. :)
But most of the time, it's the XML bit that's missed off rather than the JavaScript one. Often it's easier to pass variables along as what they are, rather than dressing them up in XML. Easier on the bandwidth again.
Agreed
In fact people for years used simple javascript rollover/onclick code that simply replaced a dynamic image with parameters for things like graphical tickboxes for switching things off and on. No XML required just simple image tags.