How to reload page on closing a Bootstrap 3 modal

后端 未结 3 888
后悔当初
后悔当初 2021-02-01 01:56

My aim is to get the page to reload when a Bootstrap modal is closed. The user can close the modal by clicking on the close button or icon or by clicking away from the modal.

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-01 02:48

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

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

    Demo

提交回复
热议问题