The jQuery plug-in Autocomplete does not support multiple Chinese characters. jqueryautocomplete
In front-end web development, when it comes to selection, Autocomplete is a very common plug-in, but this plug-in has some bugs when it comes to Chinese.
This plug-in works well every time a text is entered. When multiple text is entered at a time, it cannot be used for filtering.
This problem is particularly evident on mobile phones. This problem exists even if you use the mobile version of Autocomplete.
Check the source code. The cause is that the event. keyCode is used to filter triggered events. However, because of the special nature of Chinese input, especially on mobile phones, Pinyin is used first and then Chinese characters are selected,
If you select a Chinese character, the keyboard event cannot be triggered, and no event. keyCode exists.
The problem arises.
Modify the source code and add a listener to the input event. This event supports excellent support in chrome browsers and mobile terminals. It can listen to changes in the content of the input box in real time without waiting until the focus is lost, this is different from the onchange event.
Modify as follows:
It is about 156 rows bound to the input event.
.
Bind ("input", function () {onChange (0, true );})
After modification, the problem is solved.
Jquery autocomplete usage Problems
This is too general. First, check whether js reports errors. If no errors are reported, check whether the method is correct.
How does Jquery AutoComplete plug-in work?
... Use cookies!
Generally, AutoComplete is used to input notifications.
!!!