[Catalyst] AJAX best practices, maximum availability
Matt S Trout
dbix-class at trout.me.uk
Tue Nov 21 15:25:10 GMT 2006
Drew Taylor wrote:
> On 11/20/06, Renaud <renaud at linuxaddicts.com> wrote:
>>
>> I have a site where you can display information about restaurants. You
>> get
>> those informations with links like /restaurant/1234/menu,
>> /restaurant/1234/access, /restaurant/1234/rates...
>>
>> I'd like to update my page using ajax but without forgetting the clients
>> who cannot support it, so by default, the menu items link to
>> /restaurant/1234/menu, .../access, and so on.
>> If the client supports it, it replaces the links to functions that will
>> instead replace the content of some div where I display the requested
>> information. However to retrieve only the content of that div instead of
>> the whole page, it will fetch /restaurant/1234/menu/content,
>> /restaurant/1234/access/content, and so on...
>
> Sorry, I know nothing about the chained accessor stuff, but this is
> exactly the sort of thing I've been looking for to help me understand
> WHY I would use chained actions. :-) I got the technical bits, but I
> had not yet seen a proper use case. Now it all makes sense. Thanks!
>
> Dev folks, I would love to hear you chime in too.
Let's just say I don't remember the last time I used anything -except- Chained.
Plus, since I can do all my setup and checking in early chain parts as I load
up the data, I can't remember the last time I used auto either - these days I
just have a begin and an end in my Controller::Root (well, inherit them from
Reaction::UI::RootController tbh) and everything else is either :Chained or
:Private, and very few of the latter since I largely prefer method calls.
More information about the Catalyst
mailing list