typeahead.js README

The project's README from github.com/twitter/typeahead.js. As one markdown file: README.md.

build status Built with Grunt

typeahead.js

Inspired by twitter.com's autocomplete search functionality, typeahead.js is a flexible JavaScript library that provides a strong foundation for building robust typeaheads.

The typeahead.js library consists of 2 components: the suggestion engine, Bloodhound, and the UI view, Typeahead. The suggestion engine is responsible for computing suggestions for a given query. The UI view is responsible for rendering suggestions and handling DOM interactions. Both components can be used separately, but when used together, they can provide a rich typeahead experience.

Getting Started

How you acquire typeahead.js is up to you.

Preferred method:

Other methods:

Note: both bloodhound.js and typeahead.jquery.js have a dependency on jQuery 1.9+.

Documentation

Examples

For some working examples of typeahead.js, visit the examples page.

Browser Support

NOTE: typeahead.js is not tested on mobile browsers.

Customer Support

For general questions about typeahead.js, tweet at @typeahead.

For technical questions, you should post a question on Stack Overflow and tag it with typeahead.js.

Issues

Discovered a bug? Please create an issue here on GitHub!

https://github.com/twitter/typeahead.js/issues

Versioning

For transparency and insight into our release cycle, releases will be numbered with the following format:

<major>.<minor>.<patch>

And constructed with the following guidelines:

For more information on semantic versioning, please visit http://semver.org/.

Testing

Tests are written using Jasmine and ran with Karma. To run the test suite with PhantomJS, run $ npm test.

Developers

If you plan on contributing to typeahead.js, be sure to read the contributing guidelines. A good starting place for new contributors are issues labeled with entry-level. Entry-level issues tend to require minor changes and provide developers a chance to get more familiar with typeahead.js before taking on more challenging work.

In order to build and test typeahead.js, you'll need to install its dev dependencies ($ npm install) and have grunt-cli installed ($ npm install -g grunt-cli). Below is an overview of the available Grunt tasks that'll be useful in development.

Maintainers

Authors

License

Copyright 2013 Twitter, Inc.

Licensed under the MIT License

typeahead.js (twitter/typeahead.js)

Searching Database…

这是干什么的?Twitter 出品的一个灵活的 JavaScript 自动补全库,灵感来自 twitter.com 上的搜索自动补全。它为你在网页上搭建健壮的输入提示(搜索建议框)打下了基础。
它是一个库,还是分成几个部分?包含两个组件,可以分开用,也可以一起用:Bloodhound 是建议引擎,负责为查询计算建议项;Typeahead 是界面视图,负责把建议渲染出来并处理 DOM 交互。
怎么把它加到我的页面里?运行 bower install typeahead.js,或者直接下载 dist 文件:typeahead.bundle.js 把两个组件合在一个文件里,也有单独的 bloodhound.js / typeahead.jquery.js 可用,另外还提供压缩版 bundle。
它运行需要 jQuery 吗?需要。bloodhound.js 和 typeahead.jquery.js 都要求 jQuery 1.9+,所以要先在页面里引入 jQuery。
支持哪些浏览器?Chrome、Firefox 3.5+、Safari 4+、Internet Explorer 8+ 和 Opera 11+。移动端浏览器没有测试过,所以移动端支持算不上有保障。
我能不能只用 Bloodhound 引擎,不用 typeahead 界面?可以。README 说明两个组件可以分开使用,bloodhound.js 就是以独立建议引擎文件的形式发布的,正是为此准备的。
这个项目的灵感来自哪里?twitter.com 上的搜索自动补全。README 开头就点名它是灵感来源,这个库出自 Twitter, Inc.(Copyright 2013 Twitter, Inc.)。
Creator
twitter
Size
2.1 MB
Stars
16.4K
Updated
CommitApr 27
Age
13y
Commits · 90 Days