data-delay

Sets a type watcher delay (milisecs) before processing an ajax call.


When a form is auto-posted, this is common to set a grace delay when user is typing before sending the ajax call. data-delay let you set this grace period, better known as type watcher. You can use this option whatever if you are using events or not; it will be applied each time .domAjax is called.

data-delay uses data-delay-watcher attribute internally.
By default, data-delay is set to 800 on KeyUp events.

Usage


  • data-delay="(time in miliseconds)"

Example


  • data-delaye="800"

Live examples

This form looks like this:


<input
        type="button"
        value="Click me"
        class="btn domajax click"
        data-endpoint="delay-counter-handler.php"
        data-output="#output"
        data-delay='2000'
        />

<div id="output"></div>

This form looks like this:


<label>Default delay, type something:</label>
<input
        type="text"
        class="domajax keyup"
        data-endpoint="delay-form-handler.php"
        data-input=""
        data-output="#output"
        />

<br/><br/>

<label>Custom delay, type something:</label>
<input
        type="text"
        class="domajax keyup"
        data-endpoint="delay-form-handler.php"
        data-input=""
        data-output="#output"
        data-delay="0"
        />

<br/><br/>

<div id="output"></div>


See also    data-value 

Table of contents

All the documentation at a glance

Domajax options

And more with domajax