Ho un modal bootstrap che viene lanciato da un collegamento. Per circa 3 secondi rimane vuoto, mentre la query AJAX recupera i dati dal database. Come posso implementare una sorta di indicatore di caricamento? Twitter bootstrap fornisce questa funzionalità per impostazione predefinita?Come implementare un indicatore di caricamento per un modal bootstrap in attesa che AJAX recuperi i dati dal server?
EDIT: il codice JS per modale
<script type="text/javascript">
$('#myModal').modal('hide');
$('div.divBox a').click(function(){
var vendor = $(this).text();
$('#myModal').off('show');
$('#myModal').on('show', function(){
$.ajax({
type: "GET",
url: "ip.php",
data: "id=" + vendor,
success: function(html){
$("#modal-body").html(html);
$(".modal-header h3").html(vendor);
$('.countstable1').dataTable({
"sDom": "T<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
},
"aaSorting":[[0, "desc"]],
"iDisplayLength": 10,
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf",
"aButtons": ["csv", "pdf"]
}
});
}
});
});
});
$('#myModal').on('hide', function() {
$("#modal-body").empty();
});
</script>
codice aggiunto per JS per modale, cercherò il codice e cercare di farlo funzionare. Grazie. – devcoder