you can set the time before send, that is to say at least that the load of the beforeSend takes 1sec, and then after the success I want to close the modal and it will have to have a lapse of time. Try with the timeout
but do nothing ...
$(function(){
$("#formulario").on("submit", function(e){
e.preventDefault();
var f = $(this);
var formData = new FormData(document.getElementById("formulario"));
formData.append("dato", "valor");
$.ajax({
url: "datos.php",
type: "post",
dataType: "html",
data: formData,
cache: false,
contentType: false,
processData: false,
beforeSend: function(){
$("#mensaje").html("<div class='ui active inline loader myLoader'></div>")
},
timeout:200000,
success: function (resultado){
$("#mensaje").html(resultado);
}
});
});
});