jQuery: abort ajax request

The $.ajax method returns the xhr object, and you can call the abort method of it.

Every time you create an ajax request you could use a variable to store it:

Then you can abort ajax request:

You may also like...