Forum Moderators: coopster & phranque

Message Too Old, No Replies

How can i call perl subroutine in JSCRIPT action on onClick

same...

         

Maruthi

9:24 am on Oct 11, 2006 (gmt 0)

10+ Year Member



How can i call perl subroutine in JSCRIPT action on onClick

coopster

1:47 pm on Oct 11, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Maruthi.

Perl subroutines run on the server-side whereas the onclick attribute of an element is a client-side action. The only way to run a perl subroutine on the server on an onclick attribute would be to fetch the request from the server.

physics

4:40 pm on Oct 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure if this is what you want but you can essentially do this using XMLHttpRequest (AJAX):
[perl.com...]

physics

11:23 pm on Oct 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also, this was written for PHP but you can just as easily use it for perl:
Rasmus Lerdorf (creator of PHP) 30 second AJAX Tutorial [news.php.net]
Pretty quick solution to your question there.