Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To Ajax or Not

 
Rajan Chinna
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know when to use Ajax and when NOT to use Ajax.
 
Julian Eduardo de Anquin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that ajax is very usefull when your jsp pages has a lot of postbacks to the server. With Ajax you avoid the refreshing of the webpage.
 
Ryan Asleson
Author
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajax is best used when you want to updated small parts of the web page without forcing the user to wait through an entire refresh of the page. If most of the page needs to change then you're better off rebuilding the entire page.

I'm sure there are other rules, but this is a good one that applies in most situations.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will add my 2 cents:

My rule of thumb is common sense of not reinventing the wheel.

I see so many people using Ajax for a replacement of navigation/frame layout. I think that is a waste of effort!

I also always say: Start small and grow into it.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding another 2 cents.

Use of Ajax is no excuse to jettison years of conventional wisdom. MVC still applies. Good web application structure still applies.

Ajax is a good addition to the toolbox of existing web application know-how; not a replacement.
 
Paul Croarkin
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AJAX is used when you want to provide more "desktop-like" usability than can normally be done with simple HTTP.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Croarkin:
AJAX is used when you want to provide more "desktop-like" usability than can normally be done with simple HTTP.


While that is true, that's just a small corner of the utility of Ajax. It can also be very useful for web apps that aren't trying to mimic a desktop metaphor.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic