Display a confirmation dialog before starting the ajax call
This is very easy to click on ajaxed buttons / links, even if the targetted action is important (such as entries deletions, important updates etc). This option let you display a confirmation dialog with a customised message, and the ajax call is proceeded only if users click OK button.
This form looks like this:
<label for="insert">Enter an element</label> <input type="text" id="insert" name="insert" value="Some stuff"/> <br/> <input type="button" value="Send" class="btn domajax click" data-endpoint="confirm-table-handler.php" data-input="#insert" data-output="#output" data-confirm="Insert a new entry in the table ?" /> <p> </p> <?php // getting table contents ob_start(); include "confirm-table-handler.php"; $table = ob_get_clean(); ?> <br/> <div id="output"><?php echo $table; ?></div>
All the documentation at a glance