Pregunta

I am trying to set up twitter typeahead in my application.

http://twitter.github.io/typeahead.js/examples/

Howevery, I don't get this thing to work. I have included the js file and have this as my input

<input id="hashtag_search" name="s" type="text" class="form-control typeahead tt-query tt-hint" placeholder="#hashtag" autocomplete="off" dir="auto">

and this as my JS:

$("#hashtag_search").typeahead({    


  name: 's',                                                          
  local: ['timtrueman', 'JakeHarding', 'vskarich'] 


});

Can anyone help? Would be great.

Thanks!

EDIT: Now I am getting this as an output:

enter image description here

¿Fue útil?

Solución

it didn't work for me either until i put your JS inside $(document).ready(); block

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top