This is the easiest way to add new data in the current page after an ajax request.
There is several ways to use this option.
This form looks like this:
<div id="inputs"> <label for="name">Enter your name</label> <input type="text" id="name" name="name" value="Mike"/> <br/> <input type="button" value="Send" class="btn domajax click" data-endpoint="output-sent-div-handler.php" data-input="#inputs" data-output="#output" /> </div> <!-- here is the selected div --> <div id="output"></div>
This form looks like this:
<input id="sample" type="button" value="Click me!" class="btn domajax click" data-endpoint="output-sent-self-handler.php" data-input="" data-output="" />
This form looks like this:
<div id="sample" class="btn domajax click" data-endpoint="output-sent-self-container-handler.php" data-input="" data-output="" >Click me! </div>
This form looks like this:
<label for="firstname">Enter your first name</label> <input class="input" type="text" id="firstname" name="firstname" value="Mike"/> <br/> <label for="lastname">Enter your last name</label> <input class="input" type="text" id="lastname" name="lastname" value="Steller"/> <br/> <input type="button" value="Send" class="btn domajax click" data-endpoint="output-multiple-target-handler.php" data-input=".input" data-output=".output" /> <br/><br/> <label>HTML container output :</label> <div class="output"> </div> <br/> <label>Input field container output :</label> <input type="text" class="output" readonly/>
All the documentation at a glance