#! /usr/bin/perl -w # this is an script calls an external script and avoids caching: # NB The CGI::Ajax object must come AFTER the coderefs are declared. use strict; use CGI::Ajax; use CGI; my $q = new CGI; my $Show_Form = sub { my $html = ""; $html .= <CGI::Ajax No_Cache Example If the same URL is requested, A browser may cache the result and return it without querying the requested URL. To avoid that, use the 'NO_CACHE' keyword as a parameter in your javascript function.
Click the button and a perl script 'pjx_NO_CACHE_callee.pl should return the current time:



New Time:
EOT return $html; }; my $pjx = CGI::Ajax->new( 'perl_script' => 'pjx_NO_CACHE_callee.pl'); $pjx->JSDEBUG(1); $pjx->DEBUG(1); print $pjx->build_html($q,$Show_Form); # this outputs the html for the page