What time to send data through button type="submit"?
Tell me, how much time occurs before sending data to the server after clicking the button type="submit" on the form. For example, localhost this happens instantly, but in reality? I have animation on the button with a duration of 0.4 seconds, on localhost animation fails to work and the browser is updated, but in real projects what is it?
Depends on many factors.
From Internet speed, server load, from ping to server, even the workload of the computer.
If the animation is important - run the animation and delayed the submit of the form.
arnold2 answered on July 9th 19 at 10:21
You have the wrong approach - the animation should be hung at the event AJAX'and success. Thus it will be executed immediately after sending or receiving data.
Actually read what is callback function.
If you just submit to another page, it is possible to alter the button as to make it not submit, to tie her to function. In the function to make the animation, but by its end already submital form.