怎么办才能添加链接?

时间:2013-07-09 09:53:24

标签: facebook sdk tabs

有问题。 我创建了应用程序,允许您添加页面选项卡。 使用facebook对话框添加页面选项卡。 我不会使用链接,重定向uri移动到链接,这是在应用程序设置“页面选项卡”中输入的。 怎么办才能添加链接? 例: 如果在应用程序设置“test.com”中,我可以添加标签链接“test.com/test/index.html”

1 个答案:

答案 0 :(得分:0)

这是代码:

window.fbAsyncInit = function() {
FB.init({
    appId      : '...',
    status     : true,
    cookie     : true,
    xfbml      : true  
});

$(document).trigger('fbload');  //  <---- THIS RIGHT HERE TRIGGERS A CUSTOM EVENT CALLED 'fbload'
};

function addToPage(url) {
// calling the API ...
var obj = {
    method: 'pagetab',
    redirect_uri: url
};

FB.ui(obj, function(response){
    if (response != null && response.tabs_added != null) {
        //response.tabs_added will have an array with the ids of the tabs selected by the user
    }
});
}

var user_form_link = splitted[0]+'forms/'+uid+'.html';
addToPage(user_form_link);