JS
function get_pcap_count(){
aid=document.getElementById('AnalysisID').value;
var base_dir = "<?php echo getcwd(); ?>"+"/pcap";
$('#myPleaseWait').modal('show');
$.ajax({
async:false,
dataType:'json',
url:'./get_pcap_count.php',
type:'POST',
data:{base_dir:base_dir,aid:aid},
success:function(data){
document.getElementById('pcapcount').innerHTML=data;
},
error:function(request,status,error){
;
}
});
}
模态
<!-- Modal Start here-->
<div class="modal fade bs-example-modal-sm" id="myPleaseWait" role="dialog" aria-hidden="true" data-backdrop="static" style="position:fixed; top:33% !important;">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">
<span class="glyphicon glyphicon-time">
</span>Please Wait
</h4>
</div>
<div class="modal-body">
<div class="progress">
<div class="progress-bar progress-bar-info
progress-bar-striped active"
style="width: 100%">
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal ends Here -->
bootstrap模式不起作用ajax async false。
但是bootstrap模式可以很好地运行ajax async true。
我必须使用async false,因为防止重复。
那么如何在async中显示模态?