I am trying the following code. I want the html.concat(name)
line to work. html
is a string.
function getName() {
var name = fbName(function(name){
alert(html); //works
alert("getName: " + name); //works
html.concat(name); //fails?
alert(html); // failed: html remains unchanged
});
};
function fbName(callback){
FB.api('/' + user_id + '?fields=name', function(response) {
callback(response.name);
});
};
getName();