Home > Web Front-end > JS Tutorial > js code that imitates Baidu input box smart prompt_javascript skills

js code that imitates Baidu input box smart prompt_javascript skills

WBOY
Release: 2016-05-16 17:24:44
Original
1586 people have browsed it

Customer demands have been changing recently, but some of them were due to urgent requests from customers, so I couldn’t finish it quickly, so I made a prototype for them first, and then slowly modified it later. For example, I made a drop-down list for them in the prototype. In fact, they have more than 200 pieces of data. It is unrealistic to use a drop-down list. How can you find so much? And how long should that drop-down list be? So naturally, I thought of Baidu’s smart prompt function.

I referred to what I forgot to write before. He used Baidu API. For the sake of simplicity, I put all the data in js, so that it would be easier for readers to understand.

Let’s pass the entire code, it’s not long. Before I took the test, I forgot which hero wrote it. He used Baidu API. For the sake of simplicity, I set all the data in js, so that it would be easier for the readers to understand.

Copy code The code is as follows:




   
   
   
   



Finally, let me talk about my feelings: I interviewed as a front-end engineer before. At that time, people thought I was still young. Indeed, I was very young at that time. Now, I am starting to become stronger in the front-end field. Although the company does not have front-end engineers, I still think the front-end is very important. I need to use the front-end reasonably to solve some problems that can be easily solved with the front-end instead of leaving it to the outside world. Processed in the background. While working in the company, I didn’t learn much from others, but when the demand came, I figured out my own solutions and found some solutions online, and I also learned a lot. Keep doing it, come on!
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template