Why is this global variable not being changed???
- by user398314
Why does this turn up null instead of being set to the data returned from the ajax call? It must be something simple i am overlooking.
var message;
$(document).ready(function(){
fbFetchMessage();
alert(message);
});
function fbFetchMessage(){
var url = "http://graph.facebook.com/companyname/feed?callback=?";
$.getJSON(url,function(json){
message = json.data[0].message;
});
}