robert@0: #!C:/strawberry/perl/bin/perl.exe robert@0: robert@0: # this is an example script of how you would use URLs to define robert@0: # your CGI::Ajax functions. robert@0: robert@0: use strict; robert@0: use CGI::Ajax; robert@0: use CGI; robert@0: robert@0: my $q = new CGI; robert@0: robert@0: # the format here implies that 'convert_degrees.pl' is at the same robert@0: # level in the web server's document root as this script. robert@0: my $pjx = CGI::Ajax->new( 'myfunc' => 'convert_degrees.pl'); robert@0: $pjx->JSDEBUG(1); robert@0: robert@0: my $Show_Form = sub { robert@0: my $html = ""; robert@0: $html .= < robert@0: CGI::Ajax Outside URL Example robert@0: robert@0: robert@0:
robert@0: Degrees Centigrade:  robert@0: robert@0:
robert@0: robert@0: Degrees Kelvin:  robert@0: robert@0:
robert@0: robert@0: robert@0: EOT robert@0: robert@0: return $html; robert@0: }; robert@0: robert@0: print $pjx->build_html($q,$Show_Form); # this outputs the html for the page