Please help me figure out how $.getJSON works! I've tried to model my code off of the other $.getJSONs in the distro code but I cannot make it work. No matter how I try to implement this section of code it locks up addMarker and only 1 pin appears on my map. I know that the rest of my code works fine and that as soon as I can pull the JSON data this will work. I just can't figure out .$getJSON. Please help! Below is my code:
// array to enter headlines into
var articles = "<ul>";
var parameters = {
geo: place.postal_code
};
// gets RSS feeds and prints out linked headlines
$.getJSON("articles.php", parameters)
.done(function(data, textStatus, jqXHR) {
// add news healines to infowindow
for (var i = 0; i < data.length; i++){
articles += "<li><a href=\"" + data[i].link + "\">" + data[i].title + "</a></li>";
}
})
.fail(function(jqXHR, textStatus, errorThrown) {
// log error to browser's console
console.log(errorThrown.toString());
});
// finish HTML unordered list
articles += "</ul>";