a
r
l
i
n
a
d
e
s
i
g
n
berikut ini merupakan contoh kode :
$(function(){
$('#guard').submit(function(e) {
$.ajax({
method: 'POST',
url: 'callback.php',
data: $(this).serialize(),
dataType: 'text'
}).done(function(response) {
var result = JSON.parse(response);
swal(result.title, result.message, result.type);
}).fail(function() {
swal('Oops', 'An error occurred, please try again later. ', 'error');
});
e.preventDefault();
});
});
0 comments