2013-07-09 75 views
0

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

+0

可以告诉你你的代码? – Raptor

回答

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);