JQuery: Typeahead snippet