I'm using jQuery, and I'd like to make it so that a form submit won't work until all ajax calls have completed.
One way I have thought of doing this would be to store a boolean value which indicates whether there is an ajax request going on. It would be set to false at the end of every one.
I'm not sure if this is the best way though, so I'd appreciate any input.