-1

Can anyone tell me how to check current a working/pending ajax request in jQuery or how to stop all pending request before sending a new ajax request?

I don't need to send multiple ajax requests.

Thanks.

Sam Tyson
  • 4,496
  • 4
  • 26
  • 34
user1591760
  • 31
  • 1
  • 3
  • 1
    I think this question have already been asked :) Found via google "cancel ajax request jquery" :) http://stackoverflow.com/q/446594/1063730 – nuala Aug 19 '12 at 13:59
  • this is about how to cancel ajax request but i want to check currently working or pending ajax request in jquery ? – user1591760 Aug 20 '12 at 12:18
  • It's not an exact duplicate, but it leads you very close to a solution. Looking at what is presented in the other question, what are you struggling with? – Pekka Aug 21 '12 at 02:07

1 Answers1

0

To cancel the request you can use "abort" like the others suggest.

To check the status you can use triggers like beforeSend to know it was before sending. You can also use global triggers which might be helpful to keep track.

All the callbacks/triggers are well documented in JQuery's AJAX page.

guy mograbi
  • 27,391
  • 16
  • 83
  • 122