I need to make a function call whenever my Bootstrap modal closes (hides). This means whenever someone clicks off the modal, if they press escape, or if they click the "x" close button.
Using $("#myModal").on("hidden.bs.modal", function (e) {}); does not capture when someone presses escape or clicks off the modal, it only captures the clicking of the close button.
How can I execute a function WHENEVER my modal closes and not just on trigger of the close button?