3 ms·
Honestly, looks too complicated. I'm doing AJAX without custom JavaScript right now. The way it looks: <form action="x" replace="#y"> <!-- .. --> </form> <d
by romaniv 12y ago
Honestly, looks too complicated. I'm doing AJAX without custom JavaScript right now. The way it looks:
<form action="x" replace="#y">
<!-- .. -->
</form>
<div id="y" />
You submit the form, it loads the result in the background and replaces content of Y div with content of whatever has id="y" on the new page.
splice-result-into takes any CSS selector as its parameter, so you can apply this to multiple elements at once.
The entire library is around 100 lines of code with no dependencies. 100% backwards compatible, degradable and easy to add to existing multipage apps. It could easily be implemented as a standard HTML feature.