How to reload page on closing a Bootstrap 3 modal

Total Post:45

Points:323
 260  View(s)
Ratings:
Rate this:

I want page refresh when modal is closed.. this is my modal code

<div class="modal fade" id="dashboard" aria-hidden="true" data-backdrop="static" data-keyboard="false" role="dialog">

    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title" id="modalTitle1"></h4>
            </div>
            <div class="modal-body" id="divModelContent1">
            </div>
            <div class="modal-footer">
            </div>
        </div>
    </div>
</div>
  1. Post:52

    Points:366
    Re: How to reload page on closing a Bootstrap 3 modal

    You can bind the event to reload page on click of close:

    <script>
    
        $(document).ready(function () {
            $('#dashboard').on('hidden.bs.modal', function () {
                location.reload();
            })
        });
    </script>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!