2011-09-01 91 views
0

我有多個應用程序使用fb:朋友選擇器fb:朋友選擇器不出現

表單元素不再出現。代碼中沒有任何改變。

例子:

<div id="fb-root"></div> 
<script> 
    window.fbAsyncInit = function() { 
    FB.init({ 
     appId : 'myyappid', 
     status : true, // check login status 
     cookie : true, // enable cookies to allow the server to access the session 
     xfbml : true, // parse XFBML 
     channelUrl : 'http://mydomain.com/channel.html', // Custom Channel URL 
     oauth : true //enables OAuth 2.0 
    }); 
    }; 

    (function() { 
    var e = document.createElement('script'); 
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; 
    e.async = true; 
    document.getElementById('fb-root').appendChild(e); 
    }()); 
</script> 

<fb:serverfbml> 
<script type="text/fbml"> 
<fb:fbml> 

<fb:friend-selector /> 

</fb:fbml> 
</script> 
</fb:serverfbml> 

回答

0

剛剛找到一個解決方案,溝標準html <form>並使用<fb:editor>來代替。是的,這可能不是你想要的,但現在<fb:friend-selector>將呈現。

0

嘗試使用explixitly解析XFBML FB.XFBML.parse:
http://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse/

我也建議你把它的一些div元素
FB.XFBML內.parse(的document.getElementById( 'MY_DIV'));

+0

使用FB.XFBML.parse不會呈現fb:friend-selector。 我注意到,當它放在一個fb:request-form中時它會渲染。但是,我不想發送請求。我想以常規形式使用朋友選擇器作爲元素。 –

+0

我的回答也有幫助嗎?如果你不需要請求表單,我建議使用請求對話框,它非常簡單:http://developers.facebook.com/docs/reference/dialogs/requests/ –

+0

我不想要請求對話框或表單。我想要一個具有各種非fbml元素和fb:friend-selector的常規表單。這用於工作。現在fb:friend-selector不渲染。嘗試FB.XFBML.parse沒有做任何事情。感謝您的建議。 –