Hi, i need to show a loading gif while ajax is processing the call, this is my code
$(document).ready(function() {
$('#SubmitButton').click(function(e) {
$('#se-pre-con').show();
var userfirst = $('#userfirst').val();
var userlast = $('#userlast').val();
var useremail = $('#userlast').val();
var usertel = $('#userlast').val();
var ticketsubject = $('#ticketsubject').val();
var ticketpriority = $('#ticketpriority').val();
var ticketbody = $('#ticketbody').val();
e.preventDefault();
$.ajax({
url: "controllers/ctrl_client_new_ticket.php",
method: "POST",
data: {
userfirst: userfirst,
userlast: userlast,
usermail: useremail,
usertel: usertel,
ticketsubject: ticketsubject,
ticketpriority: ticketpriority,
messagebody: ticketbody
},
success: function() {
$('#se-pre-con').hide();
swal({
title: "Evento eliminato!",
text: "L'evento è stato eliminato con successo.",
type: "success"
},
function(){
location.reload();
}
);
}
});
});
});
I’ve added
into the html codeCan’t see any errors in the console, can anybody help me please?