简体   繁体   English

何时使用jQuery-ui自动完成功能?

[英]When to use jQuery-ui autocomplete?

I need to create input field that uses db entries to autocomplete user entered values (acceptable are only values that exists in the db). 我需要创建一个使用db条目自动完成用户输入的值的输入字段(可接受的是仅存在于db中的值)。

Can anyone explain me what is jQuery-ui autocomplete benefits doing something like described above over using jQuery, mysql and javascript? 谁能解释我通过使用jQuery,mysql和javascript进行如上所述的事情时,jQuery-ui自动完成的好处是什么?

(I am using mysql %LIKE% to search similar words.) (我正在使用mysql%LIKE%搜索相似的单词。)

jQuery-ui autocomplete is basically a widget which you can add to your front end code base, and instantiate on an input element. jQuery-ui autocomplete基本上是一个小部件,您可以将其添加到前端代码库中,并在输入元素上实例化。 Your back end should return some data in the form of JSON, which you will feed into the widget and the autocomplete functionality will start working. 您的后端应该以JSON的形式返回一些数据,您将这些数据输入到小部件中,并且自动完成功能将开始工作。 You do not have to get into the hassle of writing this functionality by yourself. 您不必麻烦自己编写此功能。 It is a well tested widget with a lot of examples online, so you can easily find out how to set it up and use. 这是一个经过良好测试的窗口小部件,在线上有很多示例,因此您可以轻松地找到如何设置和使用它。 There are many similar widgets online as well, make sure to choose the one which best suits your requirement. 网上也有许多类似的小部件,请确保选择最适合您的要求的小部件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM