in reply to Re: How to store the value of a Javascript function as a Perl variable
in thread How to store the value of a Javascript function as a Perl variable

FYI, Ed, “AJAX” simply is an ordinary HTTP transaction, but it is carried-out asynchronously through another connection with the host, with different Content-Type: and so on as appropriate.   It effectively implements a remote procedure-call (RPC) to the host, and every client-side JavaScript library in use today supports it.   On the host side, it is simply an HTTP POST/GET to a URL that is set-aside for this purpose.   On the client, the magic is done using closures, which must be provided both for normal and error responses from the host.   The customary data-transfer format, used for the actual body of the post, is ordinarily JSON or, less commonly, XML, but sometimes it is done just like ordinary form-data.

Replies are listed 'Best First'.
Re^3: How to store the value of a Javascript function as a Perl variable
by Your Mother (Archbishop) on Jun 23, 2014 at 19:20 UTC

    HTML is a perfectly valid response, meaning the Content-Type is possibly the same as the page. Ajax can be done synchronously. DELETE and PUT and other methods are acceptable and becoming common because they are preferable and necessary for real REST. Closures are not a requirement. The data transfer is rarely JSON on the way up, where regular url-encoded params are usually used, but often so on the way back.

    A shallow summary with incorrect definitions and muddy use of terms like "RPC" ingrains misimpressions.