Arief Siswanto
2019-09-12 21:46:31form html
<form id="foo">
<label for="bar">A bar</label>
<input id="bar" name="bar" type="text" value="" />
<input type="submit" value="Send" />
</form>
<!-- hasil dari cara dapat di masukkan kedalam div ini -->
<div id="result"></div>
jquery
/* Get from elements values */
var values = $(this).serialize();
$.ajax({
url: "test.php",
type: "post",
data: values ,
success: function (response) {
// respon balik dari file test.php
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(textStatus, errorThrown);
}
});
Juan Christian
2019-09-12 22:08:31