$(".getDetails").click(function() {
})
when the user presses the getDetails button on the user interface several times for a split second, jquery generates two calls for the click function and my logic crashes. I think the solution to this would be to disable the button on the first click (so use cannot click several times). As soon as I get a response or just before returning from the click method, I turn it on. Is there a better solution?
If not, how can I disable the button as soon as the user clicks the button for the first time. I think this needs to be done before calling the click method or somewhere in the html element?
Java provides a synchronized keyword, so that only one thread enters a method inside time, I'm not sure if a similar thing exists in javascript or not?
source
share