rlm@0: #!C:/strawberry/perl/bin/perl.exe rlm@0: rlm@0: use strict; rlm@0: use CGI::Ajax; rlm@0: use CGI; rlm@0: rlm@0: my $func = sub { rlm@0: my $input = shift; rlm@0: my $i=6000000; rlm@0: while($i--){ } rlm@0: return "got input: $input " . 'done'; rlm@0: }; rlm@0: rlm@0: rlm@0: sub Show_HTML { rlm@0: my $html = < rlm@0: CGI::Ajax Example rlm@0: rlm@0: rlm@0: rlm@0: rlm@0:
rlm@0: Enter Something:  rlm@0:
rlm@0: Enter Something:  rlm@0:
rlm@0:
rlm@0:
rlm@0:
rlm@0: rlm@0:
rlm@0:
rlm@0:
rlm@0: rlm@0: rlm@0: rlm@0: EOT rlm@0: rlm@0: } rlm@0: rlm@0: my $cgi = new CGI(); # create a new CGI object rlm@0: my $pjx = new CGI::Ajax( 'jsfunc' => $func ); rlm@0: print $pjx->build_html($cgi,\&Show_HTML);