, Ask how to achieve the effects of automatic prompts under input pinyin or text. Is there any plug-in available? The region is provincial, municipal, and level 3 nationwide.
, Ask how to achieve the effects of automatic prompts under input pinyin or text. Is there any plug-in available? The region is provincial, municipal, and level 3 nationwide.
Reply content:
, Ask how to achieve the effects of automatic prompts under input pinyin or text. Is there any plug-in available? The region is provincial, municipal, and level 3 nationwide.
In the simplest way, you only need to process the strings that can be hit by each word and highlight the parts.
Pinyin is a great deal. On the internet, there are a lot of js Code for converting Chinese characters into pinyin.
If you want to make it complex, Google various automatic machines by yourself.
As for the database,
Http://twitter.github.io/typeahead.js/
Http://ichord.github.io/At.js/
......
Use Auto Complete for keywords. I don't know if Chinese Pinyin is supported.
The difficulty is not to use these plug-ins... but to use these plug-ins.
- First, consider whether the automatically prompted content needs to be dynamically loaded or loaded to the page at a time.
- If it is loaded to the page at a time, the data volume is not large. If it is large, do you need to delay loading?
- For dynamic loading, you need to consider how to send Ajax requests. You do not need to set a timer for the onchange () event listener (because the input of Chinese actually enters some English conversion. For example, if you enter "you", the actually entered "n" is then "I", and then converted to "you ". If the content in the input box is changed, the Ajax request is sent, which may be sent a lot in an instant .)
- Second, if Dynamic Request loading is required, you need to consider how the backend processes the asynchronous requests sent, whether to query the database or cache, and whether the database has been indexed. How to Design the data structure if the data is cached.
A simple approach is to delay asynchronous one-time loading ....
Listen to Keyboard Events
Ajax data pulling
Jquery. autocomplete. Please give me a thumbs up. thank you and wish you a happy New Year!