How can I use the value of a JQuery/Javascript variable in a Perl script?
问题 I am a complete newbie to Perl & Javascript/Jquery/Ajax. As an example, I'd like to send the string var exampleString to test.pl, and the script will then write the string to file. function sendToScript{ var exampleString = 'this is a string'; $.ajax({ url: './test.pl', data: exampleString, success: function(data, textStatus, jqXHR) { alert('string saved to file'); } } test.pl #!/usr/bin/perl -w use strict; #How do I grab exampleString and set it to $string? open (FILE, ">", "./text.txt") ||