JavaScript wrong scope
<p>I have the JS scope mixed up. I am trying to assign to values to coordinates and use them later, but for some reason i always get the coordinates as null. </p>

<pre><code>   var thing = (function($){
  var obj = function(config) {
    $.extend(obj.config, config);
    obj.init();
  };
  $.extend(obj, {
      coordinates: {},
         browser_geolocation: function() {
             if (navigator.geolocation) {
                  var timeoutVal = 10 * 1000 * 1000;
                  navigator.geolocation.getCurrentPosition(
                  obj.browser_coordinates, //set coordinates
                    maps.browser_error,
                    { enableHighAccuracy: true, timeout: timeoutVal, maximumAge: 0 }
                  );
                }
                else {
                  alert("Geolocation is not supported by this browser");
                }
         },

         browser_coordinates: function(position) {
             obj.coordinates.long = position.coords.longitude;
             obj.coordinates.lat = position.coords.latitude;
         },
    });



 $(function() {
        maps.browser_geolocation();
            maps.browser_geolocation();

        console.log(obj.coordinates);
  });
  return obj;
}(jQuery));
</code></pre>

<p>I cant seem to figure out what I am doing wrong?</p>
