senget76 has asked for the wisdom of the Perl Monks concerning the following question:
use CGI::Ajax; use CGI; $pjx = new CGI::Ajax ('func','\&func'); $cgi = new CGI; $html=<<EOF; ... ... <Script> var previous_value; function user_click (current_value) { previous_value=current_value; func([],['change_location']); } </Script> <BODY> <a href="#" OnClick="user_click(somevalue)"> CLICK ONCE OK, SECOND TIME FAILED </a> <div id="change_location"></div> </BODY> </HTML> EOF sub func() { do something .. return something .. } $pjx->build_html($cgi,$html);
20080520 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Ajax vs javascript global var
by varian (Chaplain) on Aug 24, 2007 at 19:28 UTC | |
by senget76 (Acolyte) on Aug 29, 2007 at 01:50 UTC |