I have a link that, when clicked, opens a modal popup. If the network connection is slow, it takes some time to open a popup window. And if the user is very fast, he can click the link several times, and several pop-up windows will appear on the screen. I want the user to click the link several times.
I disabled the link on the first click. but the problem is that the popup is closed, it does not activate the link yet.
How to prevent these multiple clicks and make sure that when the popup does not appear, the link is enabled.
$('#link').click(function() {
$(this).attr("disabled", "disabled");
$("#popup").show();
});
source
share