The method FB.ui()
is used to trigger different forms of Facebook created UI dialogs. These dialogs include:
FB.ui(params, function(response))
Name | Type | Description |
---|---|---|
|
| A collection of parameters that control which dialog is loaded, and relevant settings. Click for more info. |
|
| This specifies the function that is called whenever the UI dialog is closed, either by success, cancellation, or errors. The |
Share Dialog posting a link:
FB.ui( { method: 'share', href: 'https://developers.facebook.com/docs/', }, // callback function(response) { if (response && !response.error_message) { alert('Posting completed.'); } else { alert('Error while posting.'); } } );
Note that response.error_message
only appears if someone using your app authenciated it with Facebook login.