Thursday, December 14th, 2006

Doing it Asynchronously

Category: Articles

Jeffrey Sambells has written a nice intro post on Doing it Asynchronously.

If you are new to Ajax and haven’t spent much time thinking about the A part, take a peak through the article.

Doing it Asynchronously

Posted by Dion Almaer at 11:14 am

4.1 rating from 19 votes


Comments feed TrackBack URI

This is indeed an excellent article!

Comment by Cam Turner — December 14, 2006

This article is great for the beginner, but not necessarily in-depth.
I like how they break it down into the positive aspects and uses, I hope this will clear up alot of confusion based around AJAX.

Comment by Shawn — December 14, 2006

pretty useless article, actually it doesn’t explains the meaning of A part. The main idea i see is to handle asynchronous responses via callbacks (onComplete prototype handler), but it doesn’t explains main problem:

first of all, most modern sites are using “synchronous” ajax, that doesn’t means they freeze browser by specifying “synchronous” flag to XMLHttpReuqest, but rather they follow the following steps:
onSomethingEvent -> Display “Loading” -> Make request |||||| Recieve Response -> Update Interface -> Hide “Loading”.
That’s what actually make them “SynJAX”, and that’s the problem which must be solved with “A” in AJAX, and not what Jeff writes here.

second problem, is synchronization of events. If you won’t block user with “Loading” dialog, you should handle concurrent request to the server. Let’s get back to the “check marks” sample in the article. Let’s assume you make really “A”JAX request to the server on each click. If user clicks too much and too often, there is a possibility to get out-of-order requests on the server due to network latency. I.e. your server may receive updated states in the following order: 1: enabled, 3: enabled, 2: disabled. This must be handled carefully, and solutions is not always trivial.
And that’s the _main_ problem you don’t often see the real part “A” in modern web sites.

Comment by gram — December 19, 2006

Leave a comment

You must be logged in to post a comment.