Prevent multiple AJAX calls from button/link push

Prevent multiple AJAX calls from button/link push

Hello all,

I am working on a project that relies heavily on AJAX calls, they are done in dozens of places. There are a number of places where I would want to prevent the user from submitting information multiple times (form submissions etc ). I am trying to think of the best way to accomplish this. 

I could simply disable the element that starts the AJAX call upon the first click and re-enable it upon completion of the call. I have also seen examples of developers using a class to handle ajax calls that store an identifier for the call and if it is in progress any new calls with the same identifier will be ignored.

I'm curious as to how experienced developers typically handle this. Could anyone offer suggestions? Any advice is very much appreciated, thank you!