Can I relocate to a new url after click the ok button using sweet alert?
this is my javascript file, where should I place here the code if its possible thank you
$(document).ready(function() {
$('#formA').on('submit', function(e) { //Don't foget to change the id form
$.ajax({
url: 'includes/Aenduser.inc.php', //===PHP file name====
data: $(this).serialize(),
type: 'POST',
success: function(data) {
console.log(data);
//Success Message == 'Title', 'Message body', Last one leave as it is
swal('¡Success!', 'Request sent!', 'success');
},
error: function(data) {
//Error Message == 'Title', 'Message body', Last one leave as it is
swal('Oops...', 'Something went wrong :(', 'error');
}
});
e.preventDefault(); //This is to Avoid Page Refresh and Fire the Event 'Click'
});
});