rlm@0: #!C:/strawberry/perl/bin/perl.exe rlm@0: use strict; rlm@0: use CGI::Ajax; rlm@0: use CGI; rlm@0: rlm@0: rlm@0: my $perl_func = sub { rlm@0: my $input = shift; rlm@0: rlm@0: print "got $input"; rlm@0: }; rlm@0: rlm@0: sub Show_HTML { rlm@0: my $html = ""; rlm@0: $html .= < rlm@0: CGI::Ajax Example rlm@0: rlm@0: rlm@0:
rlm@0: val1
rlm@0: rlm@0: rlm@0:
rlm@0: rlm@0: rlm@0: EOT rlm@0: rlm@0: return $html; rlm@0: } rlm@0: rlm@0: my $cgi = new CGI(); # create a new CGI object rlm@0: rlm@0: my $pjx = new CGI::Ajax( 'jsFunc' => $perl_func ); rlm@0: $pjx->JSDEBUG(1); rlm@0: $pjx->DEBUG(1); rlm@0: rlm@0: print $pjx->build_html($cgi,\&Show_HTML); # this outputs the html for the page rlm@0: