The problem is that I need to load the load only if the request takes more than 2 seconds.
I'm doing this:
$(document).ready(function () {
$(".loading").show();
$.ajax({
url: 'APP?pagina=<?= $pagina ?>',
success: function (response) {
$("#app").html(response);
$(".loading").hide();
}
});
});
loading
is the DIV that counts the loading, and it can only appear if the request takes more than 2 seconds.
Does anyone know how to do this?