Friday, January 05, 2007

How good is AJAX?

Short talk,
The post below are just written based on my understanding on AJAX. There might have some information accuracy problem. You are welcome to justify it and discuss it at the comment pane at this entry.


AJAX might be quite fresh and new for some of you, but to those who are familar with web application development, I'm sure you had been heard about this upteem times.

Well, AJAX is a quite new technology which now getting more and more popular as many famous websites are turning into the implementations of AJAX. For example, Google earth is one of the best examples of AJAX implementations. Live Mail (Microsoft Hotmail), Yahoo Mail were using this AJAX technology too.

What is AJAX?
Take a short browse to Google search engine, it gives you definition of combination of Asynchronous Javascript and XML. Basically AJAX enabled website gives you a fast response to user request compared to the old browsing experience. This is because, AJAX does not refresh the whole page each time user send a request to the server. It only refresh the a portion of the websites only. Thus, you would feel that the feedback was quick.

I would take Yahoo Mail as an example. You can see that Yahoo Mail actually divided into several segments or portion. I highlighted it into different color so that you can spot the segments border.


As you can see from the picture, the one highlighted in blue would be the menu pane, which is always there and only will be refreshed when new mails arrived. (The other pane would not be refreshed and none of the data would be send back to the server). This is one of the way AJAX improves speeds compared to the traditional style.

Besides that, each time you navigate through the tabbed menu (The one highlighted in red), the segment which highlighted in green only would be refreshed instead of whole pages. When its exchanging message and fetching data from server, you would see there is a Loading message with an animated icon inside the green area only. Thus most of the time, user thought that it was part of the animation.

Is AJAX really that good?
Well.. most of the people would amazed with the speed that AJAX provides, however most of us don't see if there is any problem at most of the time. After the taiwan quake, and internet connection distrupted, now you noticed that AJAX is not as smart as you think. Why would I say so? Ok.. the traditional server side pages exchange in page by page but AJAX only exchange part of the page (Segments or Division). Hence when the browser tries to fetch the data, most of the time the normal web browsing ables to tell when is your page going to be completed. (Progress usually shown at the browser's progress bar).

For AJAX, all you can see is "Loading"... You won't know when would it be done, and of course clicking on refresh it not a good way. Refresh button would refresh the whole page instead of that particular portion. Of course maybe programmer can put the loading progress information into the portion instead of putting the words "Loading".. but would it be confusing if there are too many figures in % in the page?

The second issue would the the "BACK" button of your browser. Ok, imaging you are happily composing the email and then click on the send button happily. Then out of sudden, you recalled that you had missed something out. On the natural instinct you would sure click on the back button and hopefully everything is there. Of course most of the web programmers would cater this problem by remains what you have typed when you click on the back button.If the page is an AJAX'ed, surely there is no BACK option for you to choose. Why? because every operation done only would refresh the portion, not the whole page. Hence browser doesn't know that the information in the page are being refreshed.

Of course actually a good AJAX programmer able to handle both of these issue well, but at this stage, how many AJAX websites do realize of these problem?

2 comments:

adrian said...

AJAX. I didn't know this method until i went to interview. Then i did a research for it.

Really a good method for web application. Not yet got chance for it. Hope soon i will able to know this method well.

littleway said...

Hmm... I am interested on this too.. and same as you, haven't mastered it.. Looks like the Atlas from Microsoft is a good tools to start with... Get the tutorial video from Microsoft websites itself. :)