+1 vote
in AJAX by
How to cancel the current request in Ajax?

1 Answer

0 votes
by
Current request in AJAX is cancelled when the user performs an action which sets off an Ajax request. This can be depicted with the help of auto-complete functionality for a search box where users can be helped with related search terms based on their current input, by making an AJAX request each time they pass a key in the search field. The user types faster than the Ajax request and you would want to abort any non-finished requests, before starting the next one.

Related questions

0 votes
asked May 15, 2022 in AJAX by Robin
0 votes
asked May 15, 2022 in AJAX by Robin
...