I am showing a Bootstrap modal window for loading when performing AJAX calls. I broadcast a \"progress.init\" event when the loading modal should show and a \"progress.finis
The best and simple approach is by using the data-dismiss attribute. Basically the data-dismiss attribute will dismiss the modal and you won't see the backdrop remaining.
All you need to do is adding the following at the place where you want to close your modal:
data-dismiss="modal"
For example, I have a button and when someone clicks the button it will close the modal.
You can also handle the JavaScript function on onClick and it will close the modal and also run the JavaScript function.
This is the best approach to do using the data-dismiss attribute.