realmonk has asked for the wisdom of the Perl Monks concerning the following question:
I know this might not be the proper way to do this however, I need a solution sometime this week. Any examples would be very useful. Thanks,#!/usr/bin/perl use CGI; use CGI::Carp qw( fatalsToBrowser ); use CGI::Ajax; use warnings; use strict; my $cgi = new CGI; my $ajax= new CGI::Ajax('report' => \&report); print $ajax->build_html($cgi, \&main); sub main { my $html = <<HTML; <html> <body> <input type="button" id="test" value="submit" onclick="report(['args__ +real','args__monk'],['report'])"> <input type="button" id="stop" value="stop"> <div id="report"></div> </body> </html> HTML return $html; } sub report { my $input1=shift; my $input2=shift; my $result=$input1.$input2; return $result; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI/AJax Question
by lostjimmy (Chaplain) on Apr 26, 2010 at 15:29 UTC | |
by realmonk (Initiate) on Apr 26, 2010 at 15:51 UTC | |
by Corion (Patriarch) on Apr 26, 2010 at 16:10 UTC |