title: how to use/store JSON data after the callback has fired?
body: <p><strong>alert:</strong> </p>
  
  <p>Basic javascript question... How can I get the data from the success handling and return a JSON object? </p>
  
  <p>Is there a away that I can place this code: </p>
  
  <pre><code>function Geo() {
      navigator.geolocation.getCurrentPosition(
          function(position) {
              I DONT WANT TO USE position here... 
              I want to place it in a var like so...
              this.data = position; // or something similar?
  
          },
          function errorCallback(error) {
              //do error handling
          }
      );
  }
  var geo = new Geo();
  geo.????? how can I get that data?
  </code></pre>
  
  <p>I tried this but it <code>this.data</code> comes back undefined</p>
  
  <p>Inside a function and call that function to get the data? I want to get that data on damand and use that data to populate different fields. I can't always use that data right there and then. </p>
  
  <pre><code>var data = ???
  </code></pre>