realmonk has asked for the wisdom of the Perl Monks concerning the following question:
This is not working any ideas how to rerun my function every 5 seconds?? Please note that#!/usr/bin/perl use CGI; use CGI::Carp qw( fatalsToBrowser ); use CGI::Ajax; my $cgi = new CGI; my $ajax = new CGI::Ajax('report' => \&report); print $ajax->build_html($cgi, \&main); sub main { $html<<HTML_MAIN; <html> <body> <input type="button" id="test" value="submit" onclick="setInterval +('report([\'args__real\',\'args__monk\'],[\'report\'])', 5000)" <div id="report"></div> </body> </html> HTML_MAIN return $html; } sub report { $input1=shift; $input2=shift; $result=$input1.$input2; return $result; }
will print out the correct values. P.S. I am running this on tomcat" please ask for clarification! Thanks, realmonkonclick="report(['args__real','args__monk'],['report'])"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ajax/perl/javascript in perl
by derby (Abbot) on Apr 26, 2010 at 12:02 UTC | |
by assemble (Friar) on Apr 26, 2010 at 20:02 UTC | |
by Your Mother (Archbishop) on Apr 26, 2010 at 20:48 UTC | |
|
Re: Ajax in perl
by Corion (Patriarch) on Apr 26, 2010 at 06:59 UTC | |
by realmonk (Initiate) on Apr 26, 2010 at 07:09 UTC | |
by Corion (Patriarch) on Apr 26, 2010 at 07:14 UTC | |
by realmonk (Initiate) on Apr 26, 2010 at 07:29 UTC | |
by bart (Canon) on Apr 26, 2010 at 08:21 UTC | |
by Corion (Patriarch) on Apr 26, 2010 at 07:37 UTC | |
|
Re: Ajax/perl/javascript in perl
by Anonymous Monk on Apr 26, 2010 at 13:25 UTC | |
by bradcathey (Prior) on Apr 27, 2010 at 00:22 UTC |