Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

javascript-perl interaction

by PriNet (Monk)
on Nov 23, 2007 at 03:15 UTC ( [id://652481]=perlquestion: print w/replies, xml ) Need Help??

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

is there a way for javascript on the client side to "signal" or cgi something back to the server that can be polled so that i know the javascript event was envoked...? i'm trying to find a way for a javascript on the client to change a variable on the server side in perl...

you mean there's any easier way?

Replies are listed 'Best First'.
Re: javascript-perl interaction
by erroneousBollock (Curate) on Nov 23, 2007 at 03:47 UTC
    The concept you're after is AJAX (Asynchronous Javascript and XML).

    The javascript should use the XMLHttpRequest object provided by the browser to make HTTP requests to the server.
    Although the AJAX acronym specifies sending XML messages, you can send whatever you like.

    Various javascript libraries exist to help you do AJAX (and other javascript tasks) more easily (and with browser bugs smoothed over).
    I'd recommend jQuery, or Dojo.

    -David

Re: javascript-perl interaction
by Gangabass (Vicar) on Nov 23, 2007 at 03:56 UTC

    Maybe hidden input field or cookie? Of course if you want interactive when use erroneousBollock suggestion.

Re: javascript-perl interaction
by sh1tn (Priest) on Nov 23, 2007 at 12:16 UTC
    In addition you may want to take a look at HTML-Prototype-1.48, which contains Prototype and script.aculo.us libraries.


Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://652481]
Approved by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-18 18:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found