title: Can't figure out geolocation
body: <p>So I'm trying to use geolocation in Javascript for the first time. I basically copied over the code from another stack overflow jsfiddle example, that worked, but I'm getting some weird errors. For awhile I was getting a "maximum callstack size exceeded jquery" error (and like 20 calls to <code>getLocation()</code> ) in the JS console, and now I'm getting nothing back - except for the little target icon in the address bar with an X over it saying location permission denied (even after automatically allowing all location requests). That's on chrome. Tried safari, it gave an alert asking for permission but then nothing happened. Still no errors. Any suggestions?</p>
  
  <pre><code>    $(window).load(function() {
      function getLocation() {
          if (navigator.geolocation) {
              navigator.geolocation.getCurrentPosition(showPosition);
          }
          else {
              $('#test').write("Couldn't fetch location.");
          };
      };
  
      function showPosition(position) {
          $('#test').write("&lt;h1&gt;Latitude: \"" + position.coords.latitude + "\"&lt;/h1&gt;");
          $('#test').write("&lt;h1&gt;Longitude: \"" + position.coords.longitude + "\"&lt;/h1&gt;");
      };
  
      getLocation();
  });, 
  </code></pre>