简体   繁体   English

jQuery tokeninput插件,返回1个字符的结果时出现问题

[英]jQuery tokeninput plugin, problem when returning results with 1 char digit

Does anyone use jquery tokeninput plugin for tag autocmpletition? 有人使用jquery tokeninput插件进行标签自动填充吗?

I have a problem, when i digit the first char in input search starts and results are ok, but dropdown autocompletition doesn't shows me results and shows me no results text, in firebug console i see : 我有一个问题,当我在输入搜索中输入第一个字符并开始输入结果就可以了,但是下拉菜单中的自动填充功能不会显示结果,也不会显示结果文本,在Firebug控制台中,我看到了:

error: invalid quantifier on plugin line 661.

if i digit more then 1 char everything is ok 如果我数字多于1个字符,一切都很好

what should be? 应该是什么?

This is a bug with the plugin. 这是插件的错误。 The plugin in the source does a RegExp on the propertyToSearch. 源代码中的插件在propertyToSearch上执行RegExp。 If the property has characters which are keywords in the RegExp then because the RegExp fails, the addition also fails. 如果该属性包含的字符是RegExp中的关键字,则由于RegExp失败,添加操作也会失败。 I tried working around with 'onResult' callback but wasn't successful. 我尝试处理“ onResult”回调,但未成功。 So, I changed my data and removed any '+', '/', '?' 因此,我更改了数据并删除了所有“ +”,“ /”,“?” etc which might conflict with regexp. 等可能与正则表达式冲突。

Hope it helps. 希望能帮助到你。

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

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