Hi Shlomi/all, i am simply trying to find a tool/module/method (as in English word method) which would allow asynchronous XMLHTTPRequest to be sent to perl CGI programs on my web server (or sub routines in a perl script) and return the value(s) to webpage to be displayed in the div i want to display on.
reading on web , i figured CGI::Ajax does it by somehow tying a JavaScript function (automatically generating JavaScript code and injecting in the perl output) to a perl subroutine. So 1)it duplicates the code of the subroutine. 2) its JavaScript code can not be cached on client and, has to be created and transferred with every page load. 3) have dependency on CGI module. (meaning even though i am generating my html using TToolkit, and doing my form validation in JavaScript, i HAVE to load the extra code of CGI module, for using CGI::Ajax). i was wondering is this possible: [example from web, modified a bit] <html> <head> <script type="text/javascript"> function processperlroutine() { var xmlhttp; xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } } xmlhttp.open("POST","/path/to/perlscript.pl",true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(); } </script> </head> <body> <h2>test</h2> <textareavalue="one record in each line" class="validate[required]" type="text" name="records" id="records" rows=5 cols=150></textarea> <p> <b>save to file:</b> <inputclass="validate[required,custom[onlyLetterNumber]] text-input" type="text" style="width:350px" name="outfile" id="outfile" /> <p> <button type="button" onclick="processperlroutine()">process data</button> <div id="myDiv"></div> </body> </html> ________________________________ From: Shlomi Fish <shlo...@shlomifish.org> To: Rajeev Prasad <rp.ne...@yahoo.com> Cc: Jeff Pang <jeffp...@mail.ru>; "beginners@perl.org" <beginners@perl.org> Sent: Thursday, September 29, 2011 1:32 AM Subject: Re: best AJAX tool/module ? Hi Rajeev, On Wed, 28 Sep 2011 20:14:29 -0700 (PDT) Rajeev Prasad <rp.ne...@yahoo.com> wrote: > how about dojo EXT motools ...etc. ? > > can these be integrated with perl CGI? Yes, they can (including jQuery). What are you trying to do exactly? Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ My Public Domain Photos - http://www.flickr.com/photos/shlomif/ <ew73> VB.NET is all of the fun of enforced privacy OO with all of the power of BASIC. — Freenode’s #perl Please reply to list if it's a mailing list post - http://shlom.in/reply .