I am trying to write a javascript function that, when called, executes the DoSomething () function once, but can be run to execute the function again until it is stopped.
I am using the setTimeout () function. I'm not sure if this is the best method in terms of performance and memory. I would also like to avoid a global variable if possible
<!DOCTYPE html> <html> <script src="jquery.js"></script> <script> var globalCheckInventory = false; $(document).ready(function(){ </script>
source share