Tuesday, November 18, 2014

When writing a "lock" around a jQuery .ajax implementation...

...with some fashion of JavaScript truthy or falsey variable being used as a flag. It might be best to...

  1. Start unlock
  2. Lock at first attempt
  3. Only unlock upon error (not success, not complete)

...if you can help it. The asynchronous churning that you don't want to interrupt by triple-clicking the button that kicks off the process is likely going to happen when things are going right. If there is not a need to allow a successful process to be run twice then just take that out of the workflow.

No comments:

Post a Comment