diff scripts/pjx_change_headers.pl @ 0:477258d09353 boosterpack

[svn r1] initial import
author robert
date Sun, 30 Aug 2009 02:19:26 -0400
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/pjx_change_headers.pl	Sun Aug 30 02:19:26 2009 -0400
     1.3 @@ -0,0 +1,41 @@
     1.4 +#!C:/strawberry/perl/bin/perl.exe
     1.5 +
     1.6 +use strict;
     1.7 +use CGI::Ajax;
     1.8 +use CGI;
     1.9 +
    1.10 +my $func = sub {
    1.11 +  my $input = shift;
    1.12 +  return "got input: $input " ;
    1.13 +};
    1.14 +
    1.15 +
    1.16 +sub Show_HTML {
    1.17 +my  $html = <<EOT;
    1.18 +
    1.19 +<html>
    1.20 +<head><title>CGI::Ajax Example</title>
    1.21 +
    1.22 +</head>
    1.23 +<body>
    1.24 +<form>
    1.25 +Enter Something:&nbsp;
    1.26 +  <input type="text" name="val1" id="val1" size="6" onkeyup="jsfunc( ['val1'], 'result' ); return true;"><br>
    1.27 +Enter Something:&nbsp;
    1.28 +    <hr>
    1.29 +    <div id="result" style="border: 1px solid black;
    1.30 +          width: 440px; height: 80px; overflow: auto">
    1.31 +    </div>
    1.32 +
    1.33 +</form>
    1.34 +</body>
    1.35 +</html>
    1.36 +
    1.37 +EOT
    1.38 +
    1.39 +}
    1.40 +
    1.41 +my $cgi = new CGI();  # create a new CGI object
    1.42 +my $pjx = new CGI::Ajax( 'jsfunc' => $func );
    1.43 +# the send in some extra headers;
    1.44 +print $pjx->build_html($cgi,\&Show_HTML, { '-expires' => '1d', '-charset' => 'ISO-8859-1'} );