I finally got the news headlines to populate the infobox. However, I havent wired up the links to the individual articles. Do all I need to do is add an "a href" tag to the json? Also, I cant click on markers. They wont pop up.One does automatically when I enter a destination, though. I think its because I have it inside of my JSON call. How can I fix this without breaking my code?
function addMarker(place)
{
markers = place;
var myLatlng = new google.maps.LatLng(parseFloat(markers.latitude),parseFloat(markers.longitude));
var marker = new google.maps.Marker({
position: myLatlng,
map: map
});
var parameters = {geo: markers.postal_code};
$.getJSON("articles.php", {geo : markers.postal_code}).done(function(data, textStatus, jqXHR) {
var content = data;
var articles = "";
var len = data.length;
for(var i = 0; i<len;i++){
articles += "<div>"+content[i].title+"</div>"
}
if(articles.length === 0){
articles = "Slow News Day!";
}
showInfo(marker, articles);
});
}