开发者

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

开发者 https://www.devze.com 2023-04-02 04:01 出处:网络
Does anyone use jquery tokeninput plugin for tag autocmpletition? I have a problem, when i digit the first char in input search starts and results are ok, but dropdown autocompletition doesn\'t shows

Does anyone use jquery tokeninput plugin for tag autocmpletition?

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 :

error: invalid quantifier on plugin line 661.

if i digit more then 1开发者_C百科 char everything is ok

what should be?


This is a bug with the plugin. The plugin in the source does a RegExp on the propertyToSearch. If the property has characters which are keywords in the RegExp then because the RegExp fails, the addition also fails. I tried working around with 'onResult' callback but wasn't successful. So, I changed my data and removed any '+', '/', '?' etc which might conflict with regexp.

Hope it helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号