Hey there, I'm a beginner in javascript and I need some help. I am trying to figure out the best way to access a json object called "js" so that I can display different content for each marker on a map. Right now, all my markers are showing the same key value, which happens to be the last one in the list.
js = JSON.parse(jss);
var infowindow;
infowindow = new google.maps.InfoWindow({
content: js.length + ' ' + iter //String(jss.length)
});
var iter = 0;
for (var key in js){
mark = new google.maps.Marker({
position: new google.maps.LatLng(key*0.5,key*0.5),
map: map,
title: 'Uluru (Ayers Rock)'
});
google.maps.event.addListener(mark, 'click', function(){
infowindow.setContent(key.toString());
infowindow.open(map,this);
});
}