2011-09-01 92 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没有做任何事情。感谢您的建议。 –