0
I’m trying to make a loading screen using modal and jquery, where while collecting the database information, it has to appear loading. But even after you have already loaded, the modal is not disappearing. Follow the code:
<!-- Modal aguarde -->
<div class="modal fade" id="modalaguarde" tabindex="-1" role="dialog" aria-labelledby="modalAguarde" aria-hidden="true">
<div class="modal-dialog modal-aguarde modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="text-center">
<img src="img/carregando.gif" class="modal-img">
<h5>carregando...</h5>
</div>
</div>
</div>
</div>
</div><!-- Fim Modal -->
$(document).ready(function(){
$('.play').click(function(e) {
e.preventDefault();
$.ajax({
url: 'url...',
type: 'post',
data: {},
dataType: 'json',
cache: false,
contentType: false,
processData: false,
beforeSend: function(){
$('#modalaguarde').modal('show');
},success: function(data){
$('#modalaguarde').modal('hide');
}
});
});
});
The main div is not closed with
</div>
.– Sam
I temporarily removed the response. I had said: "Oh yes, so the story changes rss... makes a test, comments everything inside the Success and leaves only the code that closes the modal to see if it works."
– Sam