jquery - Ajax Live Search multiple response at a time -


according question, use deboucing make live search facebook

facebook style ajax search

but here case, when set timeout 300ms, first type query , wait 300ms ajax request triggered, when waiting server response query a, query b, , after 300ms, response query shows up, , response query b shows too, see 2 results flashing, how prevent this? (cancel first request or something?)

depending on how many results return see 2 possible actions:

  • don't make new request wait old 1 complete , filter new search value
  • cancel first request , start one.

the first method work when first request returns more items displayed.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -