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

前端 未结 3 2180
感情败类
感情败类 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:31

    I have faced an Error like "TypeError: $(…).typeahead is not a function"

    Here typeahead function is not provided in bootstrap in current version that you are using.

    Now the typeahead is removed from the new release 3.0. and now this is available on typeahead.js.

    So you will have to include the the typeahead.js plugin in your file/project then your error will be remove.So include your reference to the typeahead function.

    ( Download the latest bootstrap3-typeahead.js or bootstrap3-typeahead.min.js. Include it in your source after jQuery and Bootstrap's JavaScript. )

    Link To download:

    https://github.com/bassjobsen/Bootstrap-3-Typeahead/blob/master/bootstrap3-typeahead.js

    https://github.com/bassjobsen/Bootstrap-3-Typeahead/blob/master/bootstrap3-typeahead.min.js

提交回复
热议问题