HTML引導Bootbox點擊保存按鈕
<a href="#modal-2" role="button" class="btn" data-toggle="modal">Modal with animation</a>
<div id="modal-2" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary" id="book" >Save changes</button>
</div>
</div>
我已經使用floowing JS之後,去除彈出,但沒有結果
$('#book').click(function(e) {
$.ajax({
url: base_url+"admin/login/",
type: "get",
data: {Name:name, Mobile:mobile},
success: function(strData){
//$('.modal, .modal-backdrop').hide();
$("#modal-2").modal('hide');
},
error: function(){
$('#report').text('Sorry, Please try again').css('color', 'red');
}
});
});
在這裏,我想打電話給在回調AJAX功能後,點擊保存按鈕。 然後在阿賈克斯成功後,我想關閉bootbox彈出
您的問題是什麼? – xivo
我無法關閉彈出窗口 – user123456789
在jsfiddle中運行代碼時,我沒有關閉彈出窗口的問題。你有一個問題,你添加「隱藏」到你的模態班,這將阻止你的模態打開。可能還有其他問題導致問題。 – xivo