我想從if if else block中設置stat的值,但是當我設置它並提醒它時,它對我說「undefined」。我如何設置統計值。這是我的代碼。Javascript設置變量值
deleteComment = function(postId){
var stat = "Don't Know";
FB.api(postId, 'delete', function(response) {
if (!response || response.error) {
stat = "Error2";
} else {
stat = "Deleted"
}
});
alert(stat);
};
由於提前
基本上我想返回從刪除評論的統計值 – Novice 2010-09-09 18:34:09