1

If a var is set to a jQuery $.ajax() call like so

var ajaxVar = $.ajax(...

will ajaxVar's ajax request automatically be $.abort()ed if ajaxVar is reinitialized?

I have examined the docs, and I can't find an answer.

1 Answers1

4

No, it won't be aborted. There isn't even any requirement to assign the result of $.ajax() to a variable, many applications don't bother.

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • 2
    @Gracchus with rapid requests, it's probably better to instead throttle them rather than abort them. For example, with a search-as-you-type field, only perform the ajax if they stop performing keydown events for longer than 250ms. – Kevin B Aug 30 '13 at 19:05