in reply to Re: Call Perl script from Javascript
in thread Call Perl script from Javascript
You say earlier that you already have the script that deals with the db, so instead of the echo in PHP you just need print in Perl, something like:$.get("suggest.pl", {word: $(this).val()}, function(data){ alert(data); $("#myWord").empty(); $("#myWord").html(data); });
print $q->header; while (my $row = $sth->fetchrow_hashref) { my $word = $row->{'crps_word'}; my $prob = $row->{'crps_probability'}; my $str = $prob."----".$word; print qq|<option value="$word">$str</option>|; }
|
|---|