Suppose there is a form. When the form is being submitted I’m calling an ajax request to server. While it’s being executing I don’t want that ajax call to be triggered again.
Once I the ajax call is complete then only the ajax call can be trigger again.
How can I implement this? Here I want to use JQUERY library to implement this.
Set a variable (in a scope that is wider than the function that initiates the Ajax call) to a value (such as
true) when the function runs.Set it to a different value when the callback runs.
If it is already set when the initial function runs, just return immediately.