[Catalyst] AJAX best practices, maximum availability

Renaud renaud at linuxaddicts.com
Tue Nov 21 13:13:01 GMT 2006


I will look deeper into this solution, I'm also using prototype.

Actually I also thought about setting a GET parameter like "dataonly=1",
but for some reason I do not find that elegant.

Thanks a lot for your feedbacks.


> On Tue, Nov 21, 2006 at 01:35:03AM +0000, Ash Berlin wrote:
>> The other option for AJAX would be to do something with accept-headers,
>> so make the ajax request request a different content type (I forget the
>> exact terms) and when not using ajax you process the wrapper/surrounding
>> template (i.e. the rest of the page) and then insert the output of what
>> would be the ajax command in the correct place.
>
> That's kind of what I do in many cases.  I write the feature so it
> will still work without javascript (redraw the entire page), but also
> have the action and template wrappers detect when the request is an
> ajax request and return instead json of the just the data that needs
> to be updated.
>
> I use Prototype which sets a X-Requested-With header, IIRC.
>
> --
> Bill Moseley
> moseley at hank.org
>
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>





More information about the Catalyst mailing list