1

我有一个网络应用程序,我用它来转发现有帖子,如下所示 1)使用https://graph.facebook.com/UserID_postID?access_token=AAA获取帖子详细信息(工作正常) 2)填写新帖子的数据旧的并尝试重新发送它,但是如果我使用 oldpost.link = newpost.link 它会出现一些奇怪的行为,但如果我使用 oldpost.link="\""newpost.link+"\""作品和帖子出现在 facebook 墙上,但链接显示为 invalid.invalid/

function getPost(userID, postID, token) { jQuery.getJSON("https://graph.facebook.com/" + userID + "_" + postID + "?access_token=" + token, function (post) { 这里是代码任何想法请

    var newPost = {};
    newPost.message = "hi";
      if (post.link != "" && post.link != null && post.link != "undefined") {
            newPost.link = "\"" + post.link + "\"";
        }
        if (post.name != "" && post.name != null && post.name != "undefined") {
            newPost.name = "\"" + post.name + "\"";
        }
        if (post.picture != "" && post.picture != null && post.picture != "undefined") {
            newPost.picture = "\"" + post.picture + "\"";
        }
        if (post.description != "" && post.description != null && post.description != "undefined") {
            newPost.description = "\"" + post.description + "\"";
        }



        doPost(newPost);
    });
}

function doPost(newPost) {

    FB.api('/me/feed', 'post',
              newPost, function (response) {
                    if (!response || response.error) {
                        alert(' Denied Access');
                    } else {
                        alert('Success');
                    }
                });
}
4

0 回答 0