我想在其隐藏事件上重新加载引导程序模式,因此稍后打开它时,它将再次执行我的所有js函数。如果我执行location.reload,它就可以工作,但是必须等待页面重新加载才能使我再次打开模态,这有点烦人。有什么解决方案吗?
您可以使用jQuery Ajax来获取模型的数据。
$('#myModal').on('hidden.bs.modal', function () { //modal hidden event
$.ajax({
url: "data.json",
success: function(result){
$('#myModal').html(result); //set new data to modal
$('#myModal').modal('show'); //show the modal
}
});
});