I am wondering if you know that you have a different approach to disabling an event for a while. Let me elaborate on this:
Say I have a div or button that has a subscriber to an onclick event. To prevent double-clicking when methods perform some ajax actions, these are some of the ways we can do this:
- Disable the button until the method completes its task
- Untie it until the methods finish its work, and then bind it again.
- Use some kind of flag system like boolean, so it will interfere with the method more than once.
So, are there any other ways, maybe some javascript tricks or jQuery tricks that are more efficient and better.
Thanks in advance.
source share