4 ms·
Have regular forms with action attributes, and regular links (potentially styled as buttons if it makes sense). Add a little JavaScript to make xhr (or fetch if
by stephenr 6y ago
Have regular forms with action attributes, and regular links (potentially styled as buttons if it makes sense). Add a little JavaScript to make xhr (or fetch if you prefer) requests in place of the default behaviour.
A couple of data-* attributes can help control the specific behaviour of the JavaScript meaning you probably don’t need inline/page specific is code for every instance.
This isn’t a new approach, we were doing this back when IE6 was the “mainstream” browser.