diff scripts/pjx_from_span.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_from_span.pl	Sun Aug 30 02:19:26 2009 -0400
     1.3 @@ -0,0 +1,64 @@
     1.4 +#!C:/strawberry/perl/bin/perl.exe
     1.5 +
     1.6 +use strict;
     1.7 +use warnings;
     1.8 +
     1.9 +use CGI;
    1.10 +use CGI::Ajax;
    1.11 +
    1.12 +my $cgi= CGI->new;
    1.13 +
    1.14 +my $a= CGI::Ajax->new( 
    1.15 +                       'test_elt_html'  => \&test_elt_html
    1.16 +                     );
    1.17 +
    1.18 +$a->DEBUG(2);
    1.19 +$a->JSDEBUG(2);
    1.20 +
    1.21 +print $a->build_html( $cgi, \&html_page);
    1.22 +
    1.23 +sub html_page
    1.24 +
    1.25 +  { 
    1.26 +return <<EOH;
    1.27 +<html> 
    1.28 +<head> 
    1.29 +<script>
    1.30 +function test2(){
    1.31 +    alert(typeof document.getElementById('newtest'));  
    1.32 +}
    1.33 +</script>
    1.34 +
    1.35 +</head>
    1.36 +
    1.37 +  <body>
    1.38 +    <div id="test_div">test with div</div>
    1.39 +    <p><span id="test_span">test with span</span></p>
    1.40 +    <p id="test_p">test with p</p>
    1.41 +    
    1.42 +    <div id='newtest' > some stuff </div>
    1.43 +    <hr />
    1.44 +
    1.45 +    <p><input type="button" onclick="test_elt_html( [ 'test_div' ], [ 'test_result_div' ]);" value="test div"></p>
    1.46 +    <div id="test_result_div"></div>
    1.47 +
    1.48 +    <p><input type="submit" onclick="test_elt_html( [ 'test_span' ], [ 'test_result_span' ]);" value="test span"></p>
    1.49 +    <div id="test_result_span"></div>
    1.50 +
    1.51 +    <p><input type="submit" onclick="test2();test_elt_html( [ 'newtest' ], [ 'test_result_p' ]);" value="test p"></p>
    1.52 +    <div id="test_result_p"></div>
    1.53 +
    1.54 +</body>
    1.55 +</html>
    1.56 +EOH
    1.57 +;
    1.58 +
    1.59 +  }
    1.60 +
    1.61 +
    1.62 +sub test_elt_html
    1.63 +  { my( $elt_html)= @_;
    1.64 +  print STDERR "IN:" . $elt_html , "\n";
    1.65 +    return $elt_html;
    1.66 +  }
    1.67 +