As it happens with any technology, there are ample ways to make mistakes with Ajax. Some of the problems do not have easy solutions currently but will improve as Ajax matures. As the developer community is gaining experience by developing Ajax applications, finding solutions will be easy as best practices and guidelines will be documented.
Availability of XMLHttpRequest
One of the biggest issues facing Ajax developers is how to react when XMLHttpRequest isn’t available. While the majority of modern browsers support XMLHttpRequest there will always be a minority of users whose browsers do not support it or whose browser security settings prevent XMLHttpRequest from being used. If you’re developing a Web app to be deployed on a corporate intranet, it will be easy for you to specify which browsers are supported and assuming XMLHttpRequest is always available. If you’re deploying on the public Web, however, you must be aware that by presuming XMLHttpRequest is available, you are actually depriving users of older browsers, browsers for people with disabilities or lightweight browsers on handheld devices from using your application. Therefore, you should take effective steps to make your application degrade gracefully and remain operational in browsers without XMLHttpRequest support.
Usability concerns
Some of the usability issues surrounding Ajax applications are more general. For example, it can be important to let users know that their input has been registered, because the usual feedback mechanisms of the hourglass cursor and spinning browser are not applicable to XMLHttpRequest. One technique is to replace Submit buttons with a “Now updating…” type message so that users do not repeatedly click on buttons while waiting for a response.
Another issue is that users may fail to notice that parts of the page they’re viewing have been updated. You can alleviate this problem by using a variety of visual techniques to subtly draw the user’s eye to updated areas of the page. Other issues caused by updating the page with Ajax include “breaking” the browser’s back button and the URL in the address bar not reflecting the entire state of the page, preventing bookmarking.
Server load
Implementing an Ajax User Interface in place of a regular forms-based one may considerably increase the number of requests made to the server. For instance, a regular Google Web search causes one hit on the server, occurring when the user submits the search form. However, Google Suggest, which attempts to autocomplete your search terms, sends several requests to the server as the user types. When developing an Ajax application, be careful of how many requests you will be sending to the server and the resulting server load this will cause. You can mitigate server load by buffering requests on the client and caching server responses in the client, where applicable. You should also attempt to design your Ajax Web applications so that as much logic as possible can be performed on the client, without needing to contact the server.
Dealing with asynchrony
It’s very important to understand that there is no guarantee that XMLHttpRequest will complete in the order they were dispatched. Indeed, you should assume that they will not and design your application keeping this in mind.
Tags: Pitfalls of Using AJAX



english
español
Deutsch
français
Italiano
Português
русский










Leave a reply