[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can modperl work with CGI::Ajax?


When I use the example in the document of CGI::Ajax as a ModPerl::Registry script, I couldn't get the predicted result.

#! /usr/bin/perl -w
use strict;
use CGI;      # 如果用其他的CGI编解码模块也是可以的
use CGI::Ajax;

my $cgi = new CGI;
my $ajx = new CGI::Ajax( 'exported_func' => \&sub );

print $ajx->build_html( $cgi, \&Show_HTML);

sub sub {
    my $input = shift;
    my $output = $input . " out";
    return( $output );
}

sub Show_HTML {
    my $html = qq~
     <HTML>
      <BODY>
      Please input: <input type="text" name="val1" id="val1" ['val1'], ['resultdiv'] );">
      <br><div id="resultdiv"></div>
    </BODY>
    </HTML>~;
    return $html;
  }


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.