Multi swap
Below, we’ll perform a multi-swap, which allows us to update multiple elements simultaneously in a single server response. The method is very simple, simply use multiple data-swaps attribute and send the same response with each data-swap. this action only need Briz.js. Example
<form data-ajax action="/partials/multi_swap" method="get">
<button type="submit">Greet</button>
</form>
<div data-swap="swap1">
...waiting server response
</div>
<div data-swap="swap2">
...waiting server response
</div>
<div data-swap="swap3">
...waiting server response
</div>
all data-swap above must be present in the server response so that the UI can be updated properly.
Demo
...waiting server response
...waiting server response
...waiting server response
Go back