• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Should Ajax be used for each and every click on a home page?

 
Monica Shiralkar
Ranch Hand
Posts: 842
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got a doubt. AJAX is used to do a partial refresh on a page.Suppose on home page we have different functionalities served by JSP (or Servlets or Struts). Should each be re written to support AJAX. I have seen AJAX being used in a limited way in AJAX. First click will fetch data from server. Another click now on page will bring data using AJAX not by reloading.Why not the first click itself bring data from server.

thanks
 
Ashwini Kashyap
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main purpose of AJAX is to make asynchronous calls to the server without reloading the whole page.

Suppose, there is a registration form for user, we have combo box where in when we select country, only after that combo box gets populated for states and like wise.

Loading the data all at once is a bad idea, we should load data in chunks as required which is facilitated by Ajax.

Other good example might be pagination as well, wherein we bring only that much data from the server requested by the user.

Thanks,
Ashwini Kashyap | www.infocepts.com
 
Monica Shiralkar
Ranch Hand
Posts: 842
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks.
Loading the data all at once is a bad idea, we should load data in chunks as required which is facilitated by Ajax.

Why is loading data all at once a bad idea?
 
Ashwini Kashyap
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be you bring all of the data at once but out of which only some part is required.

The intention always should be to bring only that much data on client end which is actually required.
In doing so response time of the server is faster and hence improves the performance of the server.

Thanks,
Ashwini
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic