I need to add a callback to a jQuery form submit that will be called after the request completes (something like .complete
on an AJAX request). I know that there's this question, but there's currently nothing there that works for my needs. I have a form submit that initiates a file download, so by its very nature, I can't use an AJAX request; it has to be a form submit. Is there any way that I can get the file download and have a callback called once the request completes (whether successfully or otherwise)?
I've also investigated the possibility of wrapping the form submit in a promise; but that requires the ability to pass in success/failure callbacks in the first place.
(There's also this related question, which doesn't have an answer.)