本文介绍了引导键盘缓冲的地方,prefetch,或远程需要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让this叽叽喳喳的例子预输入运行,但我得到的铬合金控制台中的错误:

I try to get this example of twitters typeahead to run but i am getting the error in chromes console:

Uncaught Error: one of local, prefetch, or remote is required jquery-1.9.1.js:507

我使用typeayhead 0.9.1(的NuGet包)。这是一个版本的问题?所有示例设置源和非本地/ prefetch /远程请求。

I am using typeayhead 0.9.1 (Nuget-Package). Is this a version problem? All examples set the source and not local/prefetch/remote in the request.

编辑:原来,Twitter的引导键盘缓冲和Twitter键盘缓冲是两个不同的库

Turned out that Twitter Bootstrap Typeahead and Twitter Typeahead are two different libraries.

推荐答案

这只是意味着你需要给在键盘缓冲将完成值搜索列表。

This only means you need to give a list in which Typeahead will search for completion value.

您必须真传至少一个数据源( prefetch 远程)或数据集(本地)。

You must really pass at least one data source (prefetch or remote) or a data set (local).

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

另外,应注意的是并是不一样的插件。他们有不同的API。你了解Twitter的引导预输入说话的文章:http://twitter.github.io/bootstrap/javascript.html#typeahead但是你用它作为Twitter的预输入!

Also, should be noted that Twitter typeahead and Twitter Bootstrap typeahead ain't the same plugin. They have different API. The article you read speak about Twitter Bootstrap typeahead: http://twitter.github.io/bootstrap/javascript.html#typeahead but you used it as Twitter typeahead!

这篇关于引导键盘缓冲的地方,prefetch,或远程需要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 01:02