<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google maps</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" charset="utf-8" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
window.onload = function(){
$.getJSON(
"cards.js",
function (data) {
var cards = data;
var len = cards.length;
// imposta le opzioni di visualizzazione
var options = {
zoom: 4,
center: new google.maps.LatLng(cards[0].Latitude,cards[0].Longitude),
mapTypeId: google.maps.MapTypeId.SATELLITE
};
// crea l'oggetto mappa
var map = new google.maps.Map(document.getElementById('map'), options);
var marker = new Array();
var infowindow = new Array();
for (a=0; a<cards.length; a++){
marker[a] = new google.maps.Marker({
position: new google.maps.LatLng(cards[a].Latitude,cards[a].Longitude),
map: map,
title: cards[a].PropertyName
});
infowindow[a] = new google.maps.InfoWindow({
content: '<img src="slide/'+a+'.jpg" height="200" width="400">'+
'<div id="tooltip">'+
'<p><strong>'+cards[a].PropertyName+'</strong><br>'+
'city: '+cards[a].City+'<br>'+
'description: '+cards[a].Description+'</p>'+
'</div>'
});
}
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
});
}
</script>
</head>
<body style="margin:0; padding:0;">
<div id="map" style="width:100%; height:100%"></div>
</body>
</html>
questo è il codice,il for per i marker funziona ma per le infowindow dei marker no, è qui che non capisco