1

I have a function that gets called whenever a user makes a keypress command. It does a bunch of stuff that is context dependent on the project I'm working on, so I'll leave out the source code. But it has an AJAX request. I want to exit from this function, wherever it may be in its execution, and call it again immediately when a new key is pressed. Currently it still finishes executing the function even when a new key is pressed.

Evan Hessler
  • 297
  • 3
  • 19

1 Answers1

1

you can use abort() to stop any AJAX requests. Please refer to this page for details.

Abort AJAX requests

namu
  • 186
  • 1
  • 13