Nick from the BadMagicNumber blog talks about how internet latencies can cause unpredictable in AJAX applications, if a human client clicks around and doesn't wait for a response. The solution is to either lock the view or pass view state down with each web request.
Read AJAX: Best practice for Asynchronous Javascript.
-
Dealing with asychronous bugs in AJAX (1 messages)
- Posted by: Floyd Marinescu
- Posted on: July 12 2005 13:27 EDT
Threaded Messages (1)
- A different approach to "1. Lock the view" by Joseph Mays on July 12 2005 20:25 EDT
-
A different approach to "1. Lock the view"[ Go to top ]
- Posted by: Joseph Mays
- Posted on: July 12 2005 20:25 EDT
- in response to Floyd Marinescu
From the article: "This means having a flag variable that makes sure only one call is in progress at any time."
Instead of doing that, quite often it is simpler and more effective to bind one XmlHttpRequest to a given data control. This is very useful for stuff like the detail popups at netflix.com (mouseover a title), or the suggest feature at google.com. Then you can do something like:
if(xmlHttp.readyState != 0)
{ xmlHttp.abort(); }
in the method that performs the request.
Joe