title: JavaScript Google Maps Geolocation How can I get the Zipcode, City, State from this?
body: <p>OK, I am taking from an example I found, but my brain is fried from the heat, and google api's always do something to me, anyway</p>
  
  <pre><code>function codeLatLng(lat, lng)
  {
      var latlng = new google.maps.LatLng(lat, lng);
      geocoder.geocode({'latLng': latlng}, function(results, status)
      {
          if (status == google.maps.GeocoderStatus.OK)
          {
              //console.log(results)
              if(results[1])
              {
                  //formatted address
                  //alert(results[0].formatted_address)
                  //find country name
                  $('#geolocation_latlng').html(latlng);
                  for(var i=0; i&lt;results[0].address_components.length; i++)
                  {
                      for(var b=0;b&lt;results[0].address_components[i].types.length;b++)
                      {
  
                          //there are different types that might hold a city admin_area_lvl_1 usually does in come cases looking for sublocality type will be more appropriate
                          if(results[0].address_components[i].types[b] == "administrative_area_level_1")
                          {
                              //this is the object you are looking for
                              city=results[0].address_components[i];
                              break;
                          }
                      }
                  }
              //city data
              //alert(city.short_name + " " + city.long_name)
              }
              else
              {
                  alert("Could not Determin Location");
              }
        }
        else
        {
            alert("Location dection failed: " + status);
        }
      });
  }
  </code></pre>
  
  <p>Its safe to assume the lat and lon are already being passed and I am getting a result, I commented out one alert for formated_address, What I am trying to do is figure out how I can take the zipcode, state, city from that formatted address and show it on screen. But like I said Im fried right now, and Im crunching a clock so I need a bit of help to kick start me.</p>