Javascript Variable Scope
问题 I'm having issues with a javascript global variable (called TimeStamp) not being defined onload...at least I think that's the problem. I start with this, defining TimeStamp. $(document).ready(function(){ // AddTest(); var TimeStamp = null; waitForMsg(); }); ...waitForMsg then runs using TimeStamp and updated it on successful completion of the ajax call. At least that's the idea, but at the moment nothing runs because "TimeStamp is not defined"...even though I defined it earlier! (urgh). If I