14 ms·
> AJAX form submission with a redirect at the end, for example, is very common. Why does that AJAX form need to pretend it's a link to a specific URL? A butto
by Dylan16807 4y ago
> AJAX form submission with a redirect at the end, for example, is very common.
Why does that AJAX form need to pretend it's a link to a specific URL?
A button would have no problem, and a link that stays on the page would have no problem.
- franga2000 4y agoThe trick works by cancelling the link click event and redirecting somewhere else in JS. The only way to prevent that would be to not allow any redirects in JS, including buttons.