Fb:connect-form

From Facebook Developer Wiki

Revision as of 04:20, 27 April 2009 by Mxmlln Montgomery Cristo (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Contents

Description

Renders an invitation widget that allows a user to invite their friends to connect their accounts. This widget is typically used in conjunction with the connect.registerUsers method.

When used on a Facebook Connect site, this tag must be used inside an fb:serverfbml tag.

Attributes

RequiredNameTypeDescription
optional condition string Indicates whether the button is visible or hidden. See the Notes below for further explanation.

Examples

<fb:serverfbml style="width: 350px;"> <script type="text/fbml"> <fb:connect-form action="http://www.example.com/post_invite.php"> </fb:connect-form> </script> </fb:serverfbml>

Notes

Using the condition Attribute

All XFBML tags support the condition attribute. This attribute determines whether an XFBML element is visible or hidden. When condition is absent, the element is visible by default. The value of condition should be a string containing some JavaScript code. The JavaScript should be evaluated into either a boolean or an FB.Waitable object whose result field is a boolean. The FB.Waitable object is designed to allow asynchronous evaluation. For example, if you want to specify an element should be visible only if the current users can see the profile of another user, you can use this markup:

<fb:container condition="FB.XFBML.Conditions.ifCanSee('1160', 'profile')"> <span>This text should be visible only if I can see the profile of user 1160.</span> </fb:container>


The following are some pre-built condition objects.

Rendering Issues

If you're having problems trying to get this form to render, try making a link that the user can click with this onclick handler:

FB.Connect.inviteConnectUsers();

That should render the Connect form in an FBML popup for you.

reference