I noticed my users sometimes click the buttons twice, maybe no one told them one click is enough.
What's the best way to prevent the double-click? I basically hide the button and show a "loading" gif, but that apparently is not enough...
I noticed my users sometimes click the buttons twice, maybe no one told them one click is enough.
What's the best way to prevent the double-click? I basically hide the button and show a "loading" gif, but that apparently is not enough...
I just found out the jQuery funcion .one(), that may be useful great for this kind of purpose! great!
Another example using a flag
Usually disabling/hiding/replacing the button should work. If they are real fast, try setting a variable to false when your script starts, return if it's true, set it to true after the first click.
Don't forget to set it to false when the user can click again.
If they are clicking fast enough to fire the double click event, return false.
EDIT: This will not cancel the single click event so problem would still exist.