title: Get city name using geolocation
body: <p>I managed to get the user's latitude and longitude using HTML-based geolocation. </p>
  
  <pre><code>//Check if browser supports W3C Geolocation API
  if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(successFunction, errorFunction);
  } 
  //Get latitude and longitude;
  function successFunction(position) {
      var lat = position.coords.latitude;
      var long = position.coords.longitude;
  }
  </code></pre>
  
  <p>I want to display the city name, it seems the only way to get it is to use a reverse geolocation API. I read Google's documentation for reverse geolocation but I don't know how to get the output on my site.</p>
  
  <p>I don't know how to go use this: <code>"http://maps.googleapis.com/maps/api/geocode/json?latlng='+lat+','+long+'&amp;sensor=true"</code> to display the city name on the page.</p>
  
  <p>How can I achieve this?</p>