This post is to remind me that the next time that I am asked to consider using AJAX on a project to actually have a more careful think about the project’s design and user interaction requirements. If I take the time to look at what I really need to retrieve dynamically then will AHAH do a better job more simply than AJAX & DOM manipulation? Will it make my application easier to test?
No great insights, rather than a prompt to ask more questions.
#1 by Adriano Almeida on 27 September 2009 - 3:06 am
Quote
Hey Thomas, I’ve been trying this approach (AHAH) for some time now, and I can say that it’s far easier to write your ajax code (JQuery’s one line of code, for instance). Some might say that you’ll have the drawbacks that you will be transferring a whole XML (html, in the case). Well, in majority of the situations this improvement is insignificant.
Regarding the tests, if you do JavaScript unit tests (QUnit, or something like this), it’ll also get easier to test, after all your code is simpler now (no “heavy” DOM manipulations). If you use a tool like Selenium to see if the ajax call is being correctly done instead, it won’t change anything on your tests.
Of course, there’s still some cases that is more helpful to use AJAX, instead of AHAH.
#2 by Tom on 27 September 2009 - 10:33 am
Quote
That’s what I found on a project where we used AHAH. We also did some cool extensions to SiteMesh allowing us to tell it to return the contents of a named div on the page rather than decorating the page. That way we did not have to have multiple versions of pages – just different decorations.