I've been working on mastering JavaScript and decided to create a script that displays all public Facebook statuses related to a specific keyword. However, things aren't going as planned. You can find a sample URL where the JSON data is located here:
Unfortunately, the script isn't generating any results. Can anyone help me identify what might be wrong?
<input type="text" id="query" /><button>add</button><br />
<div id="results">
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var url='http://graph.facebook.com/search?q=';
var query;
$('button').click(function(){
query=$("#query").val();
$.getJSON(url+query,function(json){
$.each(json.data,function(i,feed){
if(feed.type=='status') {
$("#results").append('<p>'+feed.message+'</p>');
}
});
});
});
});
</script>