Answer the question
In order to leave comments, you need to log in
How to implement opening a modal window with Bootstrap, waiting for it to close before that?
There is a modal window that opens as a result of an Ajax request. The modal window provides a choice of components and 2 buttons, after which the modal window closes, another Ajax request is sent and the same modal window opens again.
The problem is that when I try to open it again, it does not have time to close from the last time and as a result is not displayed. How can this be resolved? How can I wait for the window to completely close and then send a new request, or send a request and when trying to open check / wait for closing to open.
$('.button-without-component-send').on('click', function () {
modalComponents.modal('hide');
sendComponents();
});
$('.button-component-send').on('click', function () {
modalComponents.modal('hide');
currentPackage += 1;
sendComponents('Название');
});
function sendComponents(name = '') {
$.ajax({
........
modalComponents.modal('show');
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question