[Catalyst] Ajax and redirect
fayland
fayland at gmail.com
Mon Apr 10 10:28:01 CEST 2006
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/
More information about the Catalyst
mailing list