Create a gist now

Instantly share code, notes, and snippets.

@yko /t Secret
Created Sep 9, 2011

What would you like to do?
#!/usr/bin/env perl
use warnings;
use 5.014;
use utf8;
use Mojolicious::Lite;
get '/eingabe' => sub {
my $self = shift;
$self->render( 'eingabe' );
get '/search_db' => sub {
my $self = shift;
$self->render( json => [ 'John', 'Jack', 'Joe', 'Lisa', 'Barbara' ] );
@@ eingabe.html.ep
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src=""></script>
<script src=""></script>
<script type="text/javascript">
$( document ).ready( function() {
$( "#name" ).autocomplete({
source: '/search_db',
minLength: 2
<tr><td>Name:</td><td><input type="text"
id="name" name="name" /></td></tr>
</table><br />
<input type="submit" value="OK"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment