aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Should Ajax be used for each and every click on a home page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Should Ajax be used for each and every click on a home page?" Watch "Should Ajax be used for each and every click on a home page?" New topic
Author

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

Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 541
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

Joined: Aug 30, 2012
Posts: 90
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

Joined: Jul 07, 2012
Posts: 541
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

Joined: Aug 30, 2012
Posts: 90
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Should Ajax be used for each and every click on a home page?
 
Similar Threads
jQuery , session timeout and cache issues
selectOneMenu asynchronuous loading
How Bank sites Throw user to Session Expire Page by clicking on browser's refresh , back buttons
how to call javascript function on body load using jquery
how to remove # from url while using parent.location.hash