TypeError: $(…).typeahead is not a function

前端 未结 3 2117
感情败类
感情败类 2021-01-07 17:34

This is very basic code. Still I am facing a problem. I think I am missing something, as mentioned on bootstrap site

\"Plugins can be included indivi

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-07 18:10

    $('#search').typeahead({source: subjects}) 
    

    should be

    $('#search').typeahead({local: subjects}) 
    

    And since typeahead is no longer included in the latest standard Bootstrap package, you need to download and point to it explicitly. The download link: typeahead.js

    The latest version is 2015 so it has not been updated for a few years.

提交回复
热议问题