twitter-bootstrap 引导模式关闭后刷新页面

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44964050/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 00:55:12  来源:igfitidea点击:

Refresh page after bootstrap modal close

jquerytwitter-bootstrapbootstrap-modal

提问by Ravi Sachaniya

I am trying to refresh my current page after I close bootstrap modal.

关闭引导模式后,我正在尝试刷新当前页面。

$('#modal1').on('hide', function() {
window.location.href = 'current-page.php';
})

Is there a way for refresh current page after closing modal.

关闭模态后有没有办法刷新当前页面。

回答by Nitish Kumar Diwakar

You can refresh current page after you close modal by this:

您可以通过以下方式关闭模态后刷新当前页面:

$('#modal1').on('hide', function() {
window.location.reload();
});

回答by Ravi Sachaniya

Refresh page using location.reload();

使用刷新页面 location.reload();

$('#myModal').on('hidden.bs.modal', function () { 
    location.reload();
});