Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

CPAN's documentation for CGI::Ajax states that a Perl subroutine can direct its output to a Javascript function via syntax similar to the following:

onClick="exported_func(['input1'],[js_process_func]);"
...as long as js_process_func is not quoted. This is really handy when server processing needs to be further refined on the client side.

So, my question is whether the converse is also possible. Can I create a Javascript function which when executed calls a Perl routine on the server?

Replies are listed 'Best First'.
Re: pre-processing in CGI::Ajax?
by ikegami (Patriarch) on Jul 28, 2009 at 21:16 UTC

    Can I create a Javascript function which when executed calls a Perl routine on the server?

    That's what AJAX is!