I use the direct search function on my website (rails). Every time there is a keystroke, I submit a form. But if the user enters several characters, several search queries are sent to the server. I was wondering if there is a way to stop previous (unprocessed) requests. I want only the last request to be successfully processed.
I know that there is an abort () method that interrupts the ajax request, but I no longer have control over the previous request, so I cannot cause an interrupt while doing this. Maybe I'm something wrong here.
Is anyone
thank
Punite
source
share