how jquery finds if a modal is open code example
Example: jquery works until modal is shown
$(document).on('show.bs.modal', '#reservationModal', function (e) {
console.log('works');
});
$(document).on('show.bs.modal', '#reservationModal', function (e) {
console.log('works');
});