Request
<button mix-post="items">
Send and reload
</button>
Response
<browser
mix-redirect="/"
>
</browser>
In this example, pretend that a form has been filled up and sumibtted, or a button or link has been clicked. The request is sent to the server. The server processes the data and redirects the user to a new page. In this example a POST request is sent on click, but this can be done with any HTTP method supported by mixhtml
Note: Clicking on the button will send a request to the server and redirect the browser to the main page doing a full reload.
<button mix-post="items">
Send and reload
</button>
<browser
mix-redirect="/"
>
</browser>
In this example, the request will be triggered after 3 seconds (3000 milliseconds). While this delay is taking place with mix-delay, the caption of the button will change to "Redirecting...". This is done using mix-await.
Note: Clicking on the button will send a request to the server and redirect the browser to the main page doing a full reload.
<button mix-post="items"
mix-delay="3000"
mix-await="Redirecting ..."
mix-done="Done !"
>
Send and reload
</button>
<browser
mix-redirect="/"
>
</browser>