Friday, December 23, 2011

AJAX Application Design: Tips & Tricks

The AJAX developers need to keep in mind some crucial points when they are developing and designing applications. These facts are applicable from small to large applications. Personally I believe every AJAX developer should know all these facts for developing more robust and reliable applications. Okay, let us see them now.

The Back Button and Bookmarks are going to break down
The back button of the browser is dependent on the history object. Whenever you browse successive pages, these pages are loaded and browser’s history object saves data so that you can go back. But when you are using JavaScript to control the content and behavior of the page, the back button and bookmarks will not work any more.
So, you may develop and set your own JavaScript back button so that the user can navigate to a previous page.

There are ways to solve this problem although pretty complex.
Use Visual Cues
In most cases, AJAX applications work behind the scene. The application may take long time to load or to process lots of data. In such times, it is hard for the user to understand whether the connection with the server is dead or it is still loading and/or working. The user will feel comfortable if you can use a gif image to show that the application working and/or busy. It is common to use a rotating hourglass until data is fully loaded. You can make it appear until the data is loaded and disappear whenever all data are loaded.

document.getElementById(“loading”).style.visibility = “visible”;
document.getElementById(“loading”).style.visibility = “hidden”;

Instead of a rotating hourglass, you can also keep a blue line creeping from left to right slowly.
Let the User Control the Application
It is meaningless if the user types a wrong word and your application immediately stores it in the database. This may annoy the user easily since every user will want to correct it before it is saved in the database. It is a better way to give the user a way so that she herself can store the data when she is ready to do so. Let the user feel comfortable with your application and do not bug her with too much client server interactions.
Also remember to keep a way so that the users can undo errors they have done.

Test Your Application in Different Browsers
Even the most used two browsers Internet Explorer and Firefox do not handle the same coding in the same way. To make your coding cross browser supported, you need to be careful from very beginning. After you develop a part and test it using the commonly used browsers or by the browser the application will be used is a good practice. The more browsers support your application, the more robust and reliable you application is.

pdf url: http://tanzilo.files.wordpress.com/2008/02/microsoft-word-ajax.pdf

No comments:

Post a Comment