[Catalyst] Ajax and redirect

Carl Franks fireartist at gmail.com
Mon Apr 10 11:50:10 CEST 2006


Generally, I think JavaScript refreshes are done with:
window.location( url );


On 10/04/06, fayland <fayland at gmail.com> wrote:
> Hi, all.
> It seems that redirect doesn't work with Ajax, the reason might be Ajax
> just update a "div" and div cann't recieve the header: Location stuff.
> There is any way to get out? use "meta refresh" instead "redirect"?
>
> my code is as follows:
>
> Controller:
>
> sub vote : Global {
>     my ( $self, $c ) = @_;
>
>     $c->res->redirect('/login') unless ($c->user_exists);
>
> and TT files:
>
> var url = '/vote';
> var myAjax = new Ajax.Updater('vote_result', url, {method: 'get',
> parameters: pars});
>
> <div id='vote_result'></div>
>
> Any tips are greatly appreciated, thanks very much.
>
> --
> Fayland Lam // http://www.fayland.org/
>
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>



More information about the Catalyst mailing list