fb:friend-selector not appearing
Asked Answered
U

2

0

I have multiple apps which use the fb:friend-selector

The form element is no longer appearing. Nothing has changed in the code.

Example:

<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>
Undergrowth answered 1/9, 2011 at 1:17 Comment(0)
V
0

Just found a solution, ditch the standard html <form> and use the <fb:editor> instead. Yes, this is perhaps not exactly what you want, but now the <fb:friend-selector> will render.

Varied answered 26/9, 2011 at 12:58 Comment(0)
M
0

try to explixitly parse the XFBML using FB.XFBML.parse:
http://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse/

I'd also recommend to put it inside some div element
FB.XFBML.parse(document.getElementById('MY_DIV'));

Myrtamyrtaceous answered 1/9, 2011 at 4:35 Comment(3)
using FB.XFBML.parse doesn't render the fb:friend-selector. I notice that it does render when put in an fb:request-form. However, I do not want to send a request. I want to use the friend selector as an element in a regular form.Undergrowth
So did my answer help? If you don't want a request form I'd suggest to use a requests dialog, it is much simplier: developers.facebook.com/docs/reference/dialogs/requestsMyrtamyrtaceous
I don't want either a request dialog or form. I want a regular form that has various non-fbml elements plus a fb:friend-selector. This used to work. Now the fb:friend-selector doesn't render. Trying FB.XFBML.parse didn't do anything. Thanks for the suggestion.Undergrowth
V
0

Just found a solution, ditch the standard html <form> and use the <fb:editor> instead. Yes, this is perhaps not exactly what you want, but now the <fb:friend-selector> will render.

Varied answered 26/9, 2011 at 12:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.