[cgiapp] Ajax and JSON recipe

fREW Schmidt frioux at gmail.com
Sat Apr 11 11:39:58 EDT 2009


>
> I have a need to incorporate Ajax calls with JSON data into
> our application.  I was looking for something in terms of a piece
> of "starter" code or a recipe.  I didn't see anything on the website
> related to it.
>
> CGI Application seems like such a robust framework, that this should be
> a natural fit.
>
> Does anyone have a short starter example of code (both server and client)
> that they would be willing to post/share that would show Ajax/JSON
> usage with CGI::Application?
>
> Thanks much.
>
>
The project we are working on right now is entirely javascript on the
frontend; with a single 1-2K html file to load it all up.  One of the most
interesting things we did to make everything nice on the js side was to make
a URL generation function that you pass the controller and the runmode, and
it generates the url for that.  The great thing about that is that it
allowed us to explore using mod_perl, CGI::Appliation::Dispatch, and all
kinds of other stuff by just changing the generation function.

As for how to do it on the server side; I agree with what everyone else said
:-)  CGI::Application::Plugin::JSON has treated me well.



-- 
fREW Schmidt
http://blog.afoolishmanifesto.com


More information about the cgiapp mailing list