aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes To Ajax  or  Not 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 "To Ajax  or  Not" Watch "To Ajax  or  Not" New topic
Author

To Ajax or Not

Rajan Chinna
Ranch Hand

Joined: Jul 01, 2004
Posts: 320
I would like to know when to use Ajax and when NOT to use Ajax.
Julian Eduardo de Anquin
Greenhorn

Joined: Nov 28, 2003
Posts: 8
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

Joined: Sep 15, 2005
Posts: 39
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.


Ryan Asleson<br />Co-Author, <a href="http://www.amazon.com/Foundations-Ajax-Foundation-Ryan-Asleson/dp/1590595823/sr=1-1/qid=1158926537/ref=pd_bbs_1/002-7412154-2924860?ie=UTF8&s=books" target="_blank" rel="nofollow">Foundations of Ajax</a> and <a href="http://www.amazon.com/Pro-Ajax-Java-Frameworks/dp/1590596773/ref=sr_11_1/002-7412154-2924860?ie=UTF8" target="_blank" rel="nofollow">Pro Ajax and Java Frameworks</a><br /><a href="http://taconite.sf.net" target="_blank" rel="nofollow">Taconite</a> Lead Developer
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Jan 10, 2002
Posts: 61241
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Croarkin
Ranch Hand

Joined: Sep 30, 2004
Posts: 106
AJAX is used when you want to provide more "desktop-like" usability than can normally be done with simple HTTP.


Thanks,<br /> <br />Paul Croarkin<br />SCEA 5, SCWCD, SCJP
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61241
    
  66

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To Ajax or Not