Mercurial > rlmcintyre
annotate BoosterPack/scripts/.svn/text-base/pjx_nobuild.pl.svn-base @ 0:0d795f02a8bb tip
initial committ. what was I thinking?
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 27 Sep 2010 16:57:26 -0400 |
parents | |
children |
rev | line source |
---|---|
rlm@0 | 1 #!C:/strawberry/perl/bin/perl.exe |
rlm@0 | 2 |
rlm@0 | 3 use strict; |
rlm@0 | 4 use CGI::Ajax; |
rlm@0 | 5 |
rlm@0 | 6 my $my_func = sub { |
rlm@0 | 7 my $arg = shift; |
rlm@0 | 8 return ( $arg . " with some extra" ); |
rlm@0 | 9 }; |
rlm@0 | 10 |
rlm@0 | 11 my $pjx = new CGI::Ajax( 'tester' => $my_func ); |
rlm@0 | 12 $pjx->JSDEBUG(1); |
rlm@0 | 13 $pjx->DEBUG(1); |
rlm@0 | 14 |
rlm@0 | 15 use CGI; |
rlm@0 | 16 my $cgi = new CGI(); |
rlm@0 | 17 print $cgi->header(); |
rlm@0 | 18 |
rlm@0 | 19 $pjx->cgi( $cgi ); |
rlm@0 | 20 |
rlm@0 | 21 my $html = ""; |
rlm@0 | 22 $html .= "<HTML>"; |
rlm@0 | 23 $html .= "<HEAD>"; |
rlm@0 | 24 |
rlm@0 | 25 $html .= $pjx; |
rlm@0 | 26 |
rlm@0 | 27 $html .= <<EOT; |
rlm@0 | 28 </HEAD> |
rlm@0 | 29 <BODY> |
rlm@0 | 30 <FORM name="form"> |
rlm@0 | 31 <INPUT type="text" id="inarg" |
rlm@0 | 32 onkeyup="tester(['inarg'],['output_div']); return true;"> |
rlm@0 | 33 <hr> |
rlm@0 | 34 <div id="output_div"></div> |
rlm@0 | 35 </FORM> |
rlm@0 | 36 <br/><div id='pjxdebugrequest'></div><br/> |
rlm@0 | 37 </BODY> |
rlm@0 | 38 </HTML> |
rlm@0 | 39 EOT |
rlm@0 | 40 |
rlm@0 | 41 if ( not $cgi->param('fname') ) { |
rlm@0 | 42 print $html; |
rlm@0 | 43 } else { |
rlm@0 | 44 print $pjx->handle_request(); |
rlm@0 | 45 } |
rlm@0 | 46 |