You could wrap the entire thing in an anonymous function that you immediately execute:
(function() {
var aLockedForms = [];
...
)();
Edit: I want to clarify that this is something you can do to eliminate global variables in the future. Adam Tuttle's answer Adam Tuttle's answer is better in this case because it eliminates the variable entirely by properly utilizing the closure inside setTimeout
.
You could wrap the entire thing in an anonymous function that you immediately execute:
(function() {
var aLockedForms = [];
...
)();
Edit: I want to clarify that this is something you can do to eliminate global variables in the future. Adam Tuttle's answer is better in this case because it eliminates the variable entirely by properly utilizing the closure inside setTimeout
.
You could wrap the entire thing in an anonymous function that you immediately execute:
(function() {
var aLockedForms = [];
...
)();
Edit: I want to clarify that this is something you can do to eliminate global variables in the future. Adam Tuttle's answer is better in this case because it eliminates the variable entirely by properly utilizing the closure inside setTimeout
.
You could wrap the entire thing in an anonymous function that you immediately execute:
(function() {
var aLockedForms = [];
...
)();
Edit: I want to clarify that this is something you can do to eliminate global variables in the future. Adam Tuttle's answer is better in this case because it eliminates the variable entirely by properly utilizing the closure inside setTimeout
.
You could wrap the entire thing in an anonymous function that you immediately execute:
(function() {
var aLockedForms = [];
...
)();
You could wrap the entire thing in an anonymous function that you immediately execute:
(function() {
var aLockedForms = [];
...
)();
Edit: I want to clarify that this is something you can do to eliminate global variables in the future. Adam Tuttle's answer is better in this case because it eliminates the variable entirely by properly utilizing the closure inside setTimeout
.