[cgiapp] CA and AJAX

Michael Peters mpeters at plusthree.com
Tue Jan 29 09:29:25 EST 2008


Robert Hicks wrote:
> I am looking at the Ext Js 2.0 AJAX framework and it looks really good
> (I also like jQuery). Is anybody working on an easy way to call Ext
> stuff from Perl through CA?

Ajax stuff is fun to do, but it's really no different from normal web work, at
least from a C::A perspective. You call run modes just the same. It doesn't
matter how the request makes it to the backend. The only real differences are
the following:

+ you almost never return full pages (header, nav, footer, etc). This is pretty
easy to do with templating. I just set a no_wrapper param that goes to my
templates on Ajax requests to turn off the extra stuff I don't need.

+ JSON - If I have any advice about Ajax programming is don't use XML if you can
avoid it. It's nice to be able to read RSS feeds from some other source, but if
you can control the data source use JSON. It's faster, smaller, easier to read
and more "natural" to Perl. Check out C::A::Plugin::JSON for some easy ways to
use it

-- 
Michael Peters
Developer
Plus Three, LP



More information about the cgiapp mailing list