mixhtml

DELAY

Delay submitting data

In this example, an user can write in the input field. The system should not trigger a request inmediately after every character is typed or deleted, since this will be a waste of resources. Therefore, we can delay triggering the request and only do it once the user has stopped typing for an ammount of time.

It is recommended to trigger the request once the user has stopped typing for 0.5 seconds (500 milliseconds)

You typed:

Request

<input  type="text"
    mix-post="items"
    mix-input
    mix-delay="500"
>
<div id="data"></div>

Response

<browser mix-update="#data">
    New data
</browser>