Create new infoWindow for multiple markers generated from REST.
Hi There, how you guys doing ?
when clicking on a googlemap marker, there is an infowindow popingup. that works well.
i wanted to insert a button in this infowindow.setContent.
the button appears well.
however, the function is not triggered. error msg is "invite4Game is not defined"
here after is my code, would you guys point out something wrong ?
thk you very much in advance
<!--
// call infowindows on click
google.maps.event.addListener(marker, 'click', (function(marker, j) {
...
infowindow.setContent('<div'+locations[j][0]+'<br<img src='+IdPicSrc+' style="width:100px;height:100px"<button onclick="invite4Game()"invite4Game</button<');
// infowindow position above the chosen marker
infowindow.open(map, marker);
},2500); // end of a setTimeout
};
})(marker, j));
Code: Select all
var collector = locations[j][0];
function invite4Game() {
some code ... ;
}
} // end of listener function
--