emposha / FCBKcomplete

Jquery facebook like(fancy) multi-select
http://www.emposha.com
383 stars 115 forks source link

JS error: regular expression too complex #79

Closed andreacasarella closed 12 years ago

andreacasarella commented 12 years ago

Hi , I tried the new version available but i got a javascript error when I type on a single charater in the input field. With more than one digit I got back the list without problem but when I type for example 'a' I got this error: regular expression too complex (jquery-1.6.2.min.js) at line 3779 >> m = chunker.exec( soFar );

Is possible to fix this problem? Thanks a lot

emposha commented 12 years ago

Hi @andreacasarella, can you provide your json data?

andreacasarella commented 12 years ago

Here a little example: I think it depends on the single quote and possible special characters on the value field... I try to escape it => ' to \' but nothing change...

[{"c":"Casarella","v":"1305752634494039|Casarella|1|2"},{"c":"L' ast 1 First 1","v":"1305752977247081|L' ast 1 First 1|1|2"}]

emposha commented 12 years ago

your json data is should look like this (otherwise you chnaged fcbkcomplete.js): [{"key": "key1", "value": "value1"}, {"key": "key2", "value": "value2"}] btw: I tried to play with your json and when I changed it to this: [{"key":"1305752634494039|Casarella|1|2", "value":"Casarella"}, {"key":"1305752977247081|L' ast 1 First 1|1|2", "value":"L' ast 1 First 1"}] everything work perfect