What exactly is your question? How you can prevent to use an undefined variable?
You can either define it before any calls and initialise it to null
(var appRoot = LanesBoard2010 = null
)
or check the variable before you call console.log()
(if (appRoot) console.log('Status of app access 1: ' + appRoot);
).
I normally use the first suggestion.
I first set all my caches to null
, create the autocompletes, then use $.ajax
to load them and when loaded, update the autocomplete sources.