How can I add a loader to my ajax request?
$(document).on('click', '#reg-discagem input[type="submit"]', function(e){
e.preventDefault();
var form = $('#reg-discagem');
$.ajax({
url: 'EnviarPedidoChamada.php',
type: 'POST',
data: form.serialize()
})
.done(function(data){
$('#form-content_discagem').fadeOut('slow', function(){
$('#form-content_discagem').fadeIn('slow').html(data);
});
})
.fail(function(){
alert('Ajax Submit Failed ...');
});
});