I am working on pset8. But I am unable to get articles from articles.php. here's what my code looks like:
function getArticles(place)
{
var articles = "Slow news day!";
var parameter = {geo: place.postal_code};
$.ajax({
type: "GET",
dataType: "json",
url: "articles.php",
data: {geo: place.postal_code},
success: function(json){
articles = "<ul>";
var len = json.length;
for (var i = 0; i < len; i++)
{
articles += "<li><a href=\"" + json[i].link + "\" target = \" _blank \">" + json[i].title + "</li>";
}
articles += "</ul>"
},
});
return articles;
}
I have also tried $.getJSON. but it doesn't work