3
I have a page that is loaded via jQuery load. Inside this page is an SQL query that takes on average 8 seconds.
I’d like to put some indication that the query is loading, could be a progress bar, display percentage, a circle running, anything. I searched Goolge but found nothing that helps me. Does anyone know any way to do this?
Script that loads the page:
$(document).ready(function(){
$('.clica').click(function(){
$('#new').load('opcoesConsultaSiga.php?cond='+$(this).val());
});
});
HTML:
<button class="clica" value="-1">Exibir Tudo</button>
<button class="clica" value="2">Ordenar por estoque </button>
<button class="clica" value="4">Ordenar por custo </button>
<div id="new"></div>
Thanks for the @Kaduamaral reply, I made an update on the question explaining the problem better and put my code. According to the code I have, where I could put the
$("#loading").fadeOut('fast');
?? I tried to do in a similar way that I had found before and it didn’t work.– Amanda Lima
Hi @Amandalima, I updated the answer with your request... Test and see if it works (since I have not tested...). ;)
– KaduAmaral
It worked, thank you! But I put
$("#loading").fadeIn('fast');
inside$('.clica').click(function(){
– Amanda Lima
That actually should be right there, got the wrong answer. I’ll correct. ;)
– KaduAmaral