title: JS GeoLocation: make $.ajax wait for result
body: <p>When I send an AJAX POST request to my back-end, I want to send the latitude and longitude from navigator. But apparently, on the background, the request is being sent without even waiting for the navigator to finish.
  I am using the Parse library, is there a way I can put the request on hold until the lat/lon has been collected?</p>
  
  <pre><code>$(document).ready(function(){
      Parse.initialize("xxxxxx", "xxxxxx");
      var Location = Parse.Object.extend("Location");
      var location = new Location();
      location.save({
          latitude: latitude,
          longitude: longitude,
          description: "Testdescription",
          kind: 1
      }).then(function(object){
          alert("YAY, it worked.");
      }, function(err){
          console.log(err);
      });
  });
  </code></pre>