[Catalyst] implementing ajax

Jennifer Ahn jenahn at stanford.edu
Tue Mar 11 21:27:47 GMT 2008


Hi Ali

Thanks for your suggestions.  I was a little reluctant to explor JSON 
because I didn't find the cpan documentation or catalyst book being 
sufficient. Being that this application is my first with catalyst, I 
wanted to tackle one thing at time. Catalyst first, then all the plug in 
modules.  If you could provide a working example of hos to implement the 
js and catalyst controller part of JSON, I would greatly appreciate it!

Thanks

jennifer

Mesdaq, Ali wrote:
> Jennifer,
>
> Are you sure you want to stick with this route? Looks like your going to
> make a lot of work for yourself. I would hate to see the js code to make
> xml. Use the js code to just post the values you want read those values
> in with something like $c->request->params->{whatever} in your
> controller. Then in your controller just spit out json which is not even
> really a line of code. If your using the JSON view all you need to do is
> put your data in the $c->stash->{json} and it will auto serialize it for
> you.
>
> Why would you want to use JSON? Because javascript can just read it
> straight in and you can use it without having to parse anything. Your js
> would just eval the returned json content and use it. If you return xml
> you will need to parse it out and just makes a lot of work.
>
> If you want I can maybe create something on the wiki on how to use
> mochikit for the js part of it and catalyst for the controller part of
> it. Maybe its a good advent calendar article anyone think it would be
> good? 
>
> Thanks,
> ------------------------------------------
> Ali Mesdaq (CISSP, GIAC-GREM)
> Security Researcher II
> Websense Security Labs
> http://www.WebsenseSecurityLabs.com
> ------------------------------------------
>
> -----Original Message-----
> From: Jennifer Ahn [mailto:jenahn at stanford.edu] 
> Sent: Monday, March 10, 2008 9:37 AM
> To: The elegant MVC web framework
> Subject: [Catalyst] implementing ajax
>
> hello!
>
> i'm wondering how one would implement the server side controller end of
> an application with ajax.  i have the javascript on my client sending an
> xml file to a uri controller method but, how does the controller process
> that xml?  is the standard way of doing this by reading in the xml file
> through stdin?  i'd like to implement this without using JSON of
> jemplate.
>
> thanks for your help!
>
> jennifer
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
>  Protected by Websense Messaging Security -- www.websense.com 
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>   



More information about the Catalyst mailing list