In short,
I have a form with submit button and an ajax function which takes about 10 seconds to finish (it calls another .php file to update some records backend).
I just noticed that if I have the ajax function "ongoing" (in the process of that 10 seconds). The form submission will wait for that 10 seconds ajax call return then submit. (or maybe it's submitting but the form submission takes 10 seconds anyway)
If I wait until the ajax call returns then submit, it only takes 1 second to submit the form.
I thought ajax should be "async" and should not block anything on the page? Am I wrong? How should I make it "async" so it does not block any other links or submit buttons on the page while the ajax is running?
To be clear: I'm trying to submit the form and have the ajax call running in parallel.