简体   繁体   中英

Bootstrap Twitter typeahead setup not working

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:

在此处输入图片说明

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM