5 tips to use Ajax in the proper way

Ajax (Asynchronous JavaScript with XML) is used to provide a rich user interface, which allows the users to browse through a second component of a web page while the page fetches some data from some server for the first component. This type of request is called as an asynchronous request and it makes a web application more user-friendly since the request made does not block the user from doing other activities in the page.

This does not mean that all of the page content should be brought asynchronously as it would be the doing the same old things in a new fashion. AJAX promotes interactivity i.e. where in a web page which has a lot of components along with data to display to the user, some of the components can be dynamically updated without having to move the user away from the page for refreshing or doing some other activity. The user can access other components of the page while the update is in progress, which adds to the richness of the site or application. Web applications developed in this manner are called as a Rich Internet Applications (RIA).

The 5 tips to use AJAX in the proper way are:

  1. Choose the right framework
  2. Decide on a server side or a client side framework
  3. Never bloat your code
  4. Never try to ajaxify all the pages
  5. Test your code properly

I will be elaborating on each of these tips in the coming posts since they are have a detailed explanation and I will be providing some examples that I myself have come across and will relate the explanations to them.

One thought on “5 tips to use Ajax in the proper way

Leave a Reply

Your email address will not be published. Required fields are marked *