title: How can I pass data from an ajax request to a global variable?
body: <p>Ok.  I'm totally baffled.  Here's the code:</p>
  
  <pre><code>$(document).ready(function(){
  var newToken = 1;
  
  $.get("junk.php",
      function(newToken) {
          alert(newToken); // alerts "junk"
      });
  alert(newToken); // alerts "1"
  });
  </code></pre>
  
  <p>As per my comments, the first alert of newToken is "junk" (the only output of junk.php).  Once outside the .get, newToken reverts to "1".  I need to get this variable set to the output from junk.php.  Is this not possible?  I've tried everything, and searched everywhere.</p>
  
  <p>Thanks.</p>