title: Google maps not displaying description of markers
body: <p>I want to display title/description on click of markers. Markers are getting displayed but on click description not getting displayed. I saw in console log error message is "Uncaught TypeError: Cannot read property '0' of undefined on line no 40", i dont know whats wrong with my code, can anyone help me?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>   var locations = [
        ['Asia','Asia'],
        ['America','America'],
        ['India','India']
      ];
  
      var map = new google.maps.Map(document.getElementById('map'), {
        zoom: 1,
        center: new google.maps.LatLng(0,0),
        mapTypeId: google.maps.MapTypeId.ROADMAP
      });
  
      var infowindow = new google.maps.InfoWindow();
  
      var marker, i;
  
      for (i = 0; i &lt; locations.length; i++) { 
       var url = 'http://maps.googleapis.com/maps/api/geocode/json?address='+locations[i][1]+'&amp;sensor=false';
          $.getJSON(url, function (data) {
              var p = data.results[0].geometry.location;
              var latlng = new google.maps.LatLng(p.lat, p.lng);
              marker = new google.maps.Marker({
                  position: latlng,
                  map: map
              }); 
  
           google.maps.event.addListener(marker, 'click', (function(marker, i) {
          return function() {
            infowindow.setContent(locations[i][0]);
            infowindow.open(map, marker);
            }
            })(marker, i));
         });
      }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#map{
     height:400px;
     width:500px; 
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt; &lt;/script&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/jquery-2.2.1.min.js"&gt;&lt;/script&gt;
  &lt;div id="map"&gt;&lt;/div&gt;
  
  &lt;</code></pre>
  </div>
  </div>
  </p>