How do I make my live jQuery search wait a second before performing the search?

前端 未结 6 2047
灰色年华
灰色年华 2020-12-13 04:52

I\'ve got a search input which sends data from an input to a php file as I type. The php file does a search on my database and shows up a list of search options. You know, t

6条回答
  •  执念已碎
    2020-12-13 05:46

    You really ought to look at using the jQuery autocomplete plugin. I find this plugin to be very useful and it already does what you need. Look particularly at the delay option, which you can customize to change how long the plugin waits after a keystroke to run.

提交回复
热议问题