I'm working on a small funny bit of code and i'm stuck.
on line 66 in the JS file. it cant define data... it is in the scope right?
please help me.
http://codepen.io/shiva112/pen/JGXoVJ
function PlaceMarkers(data){
for (i = 0; i < data.length - 1; ++i) {
if (data[i].country == "NL"){
map.addMarker({
lat: data[i].lat,
lng: data[i].lng,
title: 'Marker with InfoWindow',
infoWindow: {content: "Station: " + data[i].name},
click: function(e) {
$("#info h2").remove();
$("#info").append( "<h2>U hebt station " + data[i].name + " geselecteerd.</h2>" );
}
});
}
}
the append line is not working. data[i].name 2 lines above is in the scope!! but why not the data[i].name in the append line..