views:

16

answers:

0

I'm building an autocompletion system in jQuery, and I want to know the best way to deal with text pasting and deletion from the middle or beginning of the query. I would rather not reparse the whole query for each keystroke, as my parsing takes a significant amount of time to parse the whole query as opposed to additionally parsing just the latest keystroke.

So what's the best way to set up my autocompletion system parsing only the latest keystroke but still being able to deal with deleting a character from the middle of the query or pasting text into the query?