Javascript-input prompt

Source: Internet
Author: User
, 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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.