1
I want to display a message like "loading" while processing the registration and another with "Registration completed", this is my AJAX code
$.ajax({
type: "POST",
url: "http://localhost:5001/v1/enterprise",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: JSON.stringify(data),
crossDomain: true,
success: function(data) {
guid = data;
$(".cad_sucesso").css({
display: 'block'
})
setTimeout(function() {
$(".cad_sucesso").fadeOut();
$(".processo_sucesso").css({
display: 'block'
})
setTimeout(function() {
window.location.href = "/dataImmobile/DataImmobile/NewImmobile";
}, 1000);
}, 3000);
},
failure: function(data) {
alert(data.responseText);
},
error: function(data) {
alert(data.responseText);
}
});
What am I doing here? Displaying first a div with a message 'Loading', and after a few seconds displays the div with the message 'Registration completed', but it is not dynamic because I am setting the time to display the messages. How I take the time of this requisition?
try using a modal instead of Alert
– tomasantunes
see if this link helps you: https://answall.com/questions/75743/loading-no-ajax
– aa_sp