title: JavaScript asynchronous return value / assignment with jQuery
body: <p>I have the following jQuery Function.  I'm trying to return the GUID value shown here in the <code>alert();</code> The alert works fine and the value is populated, however I can't seem to assign it to a variable and return its value.</p>
  
  <p>Ultimately I need to access the GUID value in other functions, etc. Everything I've tried only displays as <code>undefined</code>.</p>
  
  <p>I'd like to do something like this:</p>
  
  <pre><code>function trackPage(){
      var elqTracker = new jQuery.elq(459);
      elqTracker.pageTrack({
          success: function() {
              elqTracker.getGUID(function(guid) {
                  alert(guid);
                  var returnValue = guid;
              });
          }
      });
      return returnValue;
  }
  
  var someGuid = trackPage();
  </code></pre>