I have successfully implemented the event listener for add marker and am able to display strings when a marker is clicked. However, I cannot workout why my $.getJSON code that brings articles data is not working. An extract of my code is below (note, markers
is what I have redefined place
as).
I have tried both defining the geo as a parameter and the version below, a variant of which worked for a classmate in another question, but with no luck. The map loads without errors, but when a marker is clicked it always displays "Slow news day!" and never any articles. Thanks so much for any help.
var articles = "Slow news day";
$.getJSON("articles.php?geo="+markers.postal_code,function(data) {
if (data !== null) {
var articles = data;
}
});