需要Bootstrap Typeahead本地,预取或远程

dan*_*iel 14 javascript jquery bootstrap-typeahead typeahead.js twitter-typeahead

我试图让这个 twitters typeahead的例子运行,但我在chromes控制台中收到错误:

未捕获错误:需要本地,预取或远程之一jquery-1.9.1.js:507

我正在使用typeayhead 0.9.1(Nuget-Package).这是版本问题吗?所有示例都在请求中设置源而不是local/prefetch/remote.

编辑:原来,Twitter Bootstrap Typeahead和Twitter Typeahead是两个不同的库.

Sim*_*ias 11

这仅表示您需要提供Typeahead将搜索完成值的列表.

您必须真正传递至少一个数据源(prefetchremote)或数据集(local).

https://github.com/twitter/typeahead.js#jquerytypeaheaddatasets


另外,应该注意的是Twitter typeaheadTwitter Bootstrap typeahead是不一样的插件.他们有不同的API.你读过的文章谈到Twitter Bootstrap typeahead:http://twitter.github.io/bootstrap/javascript.html#typeahead但你用它作为Twitter类型!

  • 哦,我明白了问题所在._Twitter Typeahead_和_Twitter Bootstrap typeahead_不是同一个插件.他们有不同的API.你读过的文章谈到twitter bootstrap typeahead:http://twitter.github.io/bootstrap/javascript.html#typeahead (2认同)