A real-time search box I made recently: Link address
Is it similar to this? If you don't use a plug-in, the idea is very simple: listen to the user's input events, send an ajax request to PHP, PHP can simply check the database, or if the matching requirements are high, use Sphinx mentioned above, and then display the callback data to an absolute Just position it on p.
There is something worth mentioning: because this time it is to be compatible with mobile terminals, the input events of the mobile phone’s input method are different from those of the PC, and the keyup|down|press events of javascript are not well supported, so the input event needs to be bound;
The essence is ajax
js combination
Cooperate with creating sphinx index
Your problem description is not very clear.
Do you want to record real-time user searches? Still want to query the database when the characters in the user input box change
Use setTimeOut(), and then there is ajax inside, it should be like this
A real-time search box I made recently: Link address
Is it similar to this? If you don't use a plug-in, the idea is very simple: listen to the user's input events, send an ajax request to PHP, PHP can simply check the database, or if the matching requirements are high, use Sphinx mentioned above, and then display the callback data to an absolute Just position it on p.
There is something worth mentioning: because this time it is to be compatible with mobile terminals, the input events of the mobile phone’s input method are different from those of the PC, and the keyup|down|press events of javascript are not well supported, so the input event needs to be bound;