Tell me, it’s very urgent to figure out how to fill out a form, send data to a perl-script, and then return the result to the page without reloading. While such a simple example
<html lang="en-US"> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ // по завершению загрузки страницы $('#myform').submit(function(){ $.ajax({ type: "POST", url: "1.html", success: function(data){ $(".result").html(data); } }); return false; }); }); </script> </head> <body> <form id="myform" method="get" action="1.pl"> <input type="text" name="surname" id="username"> <input id="submit_button" type="submit" value="Отправить"> </form> <div class="result"> </div> </ body> </ html>
And a perl handler
#!/usr/bin/perl -w use CGI; use Fcntl; $q = CGI->new; my $f = $q->param("surname") . "Пенза!"; return $f; By clicking on the button, the page code is returned and another page for data entry and a button is displayed on the page.