[英]how to close a modal (bootstrap) and reload the page with angularjs?
[英]How to reload page on closing a Bootstrap 3 modal
我的目標是在Bootstrap模式關閉時重新加載頁面。 用戶可以通過單擊關閉按鈕或圖標或單擊遠離模態來關閉模態。
到目前為止,我的代碼非常標准。 取自: http : //getbootstrap.com/javascript/#modals
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch
</button>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">My title</h4>
</div>
<div class="modal-body">
My content
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
如何在關閉模式后重新加載頁面?
更新:哇,來自每個人的驚人快速反應。 謝謝
試試這個按鈕:
onclick="javascript:window.location.reload()"
完整按鈕:
<button type="button" onclick="javascript:window.location.reload()" class="close" data-dismiss="modal" aria-hidden="true">×</button>
例如: http : //jsfiddle.net/Valtos/52VtD/2288/embedded/result/
$('#myModal').on('hidden', function () {
document.location.reload();
})
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.