Javascript variable problem, simple question
<pre><code>var num = rez.data.length;

for(var key=0;key&lt;num;key++)
{
  var marker = [];
  var point  = new GLatLng(rez.data[key].latitude, rez.data[key].longitude);
  marker[key] = new GMarker(point, {icon: iconS});
  GEvent.addListener(marker[key], "click", function() 
  {
    marker[key].openInfoWindowHtml('xxxxxx');
  });
  map.getMap().addOverlay(marker[key]); 
}
</code></pre>

<p>I need help here, can anyone tell me why is <code>marker[key]</code> in line <code>marker[key].openInfoWindowHtml('xxxxxx');</code> undefined? I defined it here: <code>marker[key] = new GMarker(point, {icon: iconS});</code></p>
