title: Google Map infowindow showing last value of loop
body: <p>I have used for loop to display the markers and info window. But the infowindow showing only the last value of the loop. </p>
  
  <p>Here is the code im using. </p>
  
  <pre><code>  function initialize()
      {
          try
          {
              var geocoder;
              var map;
              geocoder = new google.maps.Geocoder();
              var latlng = new google.maps.LatLng(41.511770, -72.809520);
              var mapOptions = {              
                center: latlng,
                 zoom: 9,
              disableDefaultUI: true,
              mapTypeId: google.maps.MapTypeId.ROADMAP 
              }
              map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
              var markers = JSON.parse('[{"address":"40C Leslie Road,Bridgeport,CT","Description":"Bridgeport - 82 Unit Community"},{"address":"56 Ironwood Road,West Hartford,CT","Description":"West Hartford - 45 Unit Community"}]');
              var infoWindow = new google.maps.InfoWindow();
             // var address;
              for (i = 0; i &lt; markers.length; i++)
              {
                  var address = markers[i];               
                  geocoder.geocode({ 'address': address.address }, function (results, status)
                  {
                      if (status == google.maps.GeocoderStatus.OK) 
                      {
                          //map.setCenter(results[0].geometry.location);
                          var marker = new google.maps.Marker({
                              map: map,
                              icon:'Images/pin.png',
                              position: results[0].geometry.location
                          });
                          google.maps.event.addListener(marker, "click", function (e)
                          {                       
                              infoWindow.setContent("&lt;div style='border:0px solid red;height:auto;;width:auto;'&gt;" + address.Description + "&lt;/div&gt;");
                              infoWindow.open(map, marker);
                          });
                      }
                      else {
                          //alert("Geocode was not successful for the following reason: " + status);
                      }
                  });
  
                //  map.setCenter(new google.maps.LatLng(41.511770, -72.809520))
              }
          }
         catch (ex)
          {
              alert(ex.message);
          }     
      }
  
      google.maps.event.addDomListener(window, "load", initialize);
  </code></pre>
  
  <p>Please help me. </p>
  
  <p>Thanks,
  Venkat.</p>