in reply to CGI::Ajax vs javascript global var

$pjx = new CGI::Ajax ('func','\&func');
does not pass the Perl code reference properly, it should read:
$pjx = new CGI::Ajax ('func' => \&func);
otherwise the Perl call server side fails.

You may want to have a look at one of the CGI::Ajax examples that come with the module.

Replies are listed 'Best First'.
Re^2: CGI::Ajax vs javascript global var
by senget76 (Acolyte) on Aug 29, 2007 at 01:50 UTC
    opps.. my mistake in the sample
    but in my code it has the correct syntax
    $pjx = new CGI::Ajax ('func' => \&func);

    coz it execute seccussfuly, on the first time but in second time, it complains about javascript "previous_value"

    my code is pretty long, so, I made a simplified version
    I tried it several time but ended up using workaround using
    hidden input to keep the previous value