|
Since loadContent is defined inside the "if" block, Javascript won't create it unless the "if" condition is true. Functions which are defined outside any "if" statement get created right up front, so the solution is to put all your function definitions outside of any "if" blocks.
|