jquery自动完成匹配
我正在使用这个 JQuery 自动完成插件。似乎默认情况下它从一开始就匹配,所以“foo”会匹配“fool”,但不会匹配“bufoon”。
我希望匹配发生在任何地方并且不区分大小写,这样“foo”将匹配
- 傻瓜
- bufoon
- Foo Fighter
这些选项似乎没有记录在任何地方,所以我查看了 源代码来弄清楚这是否可能,但找不到任何明显的方法来更改匹配算法,但我觉得很难相信不支持此操作。
I'm using this JQuery Autocomplete plugin. It seems that by default it matches from the start, so "foo" would match "fool", but not "bufoon".
I want the matching to occur anywhere and case insensitively, such that "foo" would match
- fool
- bufoon
- Foo Fighter
The options don't appear to be documented anywhere, so I had a look though the source code to figure out if this is possible but couldn't find any obvious way to change the matching algorithm, but I find it hard to believe this isn't supported.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一个选项
matchContains
,默认情况下为 false。将其设置为 true。 示例这是选项列表。请务必单击“选项”选项卡
There is an option,
matchContains
, that is false by default. Set it to true. ExampleHere is a list of options. Be Sure to click the "options" tab
我也做过类似的事情。这就是你可以做到的:
I have done something similar. That's how you can do it: