Это то, что я использую.В нем также есть вся обработка ошибок:
FB.ui
(
{
method : 'apprequests',
data: '',
display: 'dialog',
title : 'Invite a Friend',
message: 'I just sent you an invitation to play My Game.',
filters: ['app_non_users']
}, function(response)
{
if (response && response.request_ids)
{
jQuery.ajax
(
{
url: 'Invite_Request.php',
type: 'GET',
data:
{
'request_id': response.request_ids, 'signed_request': "<?php echo $_SESSION["SR"] ?>"
},
success: function(data)
{
if (data.error)
{
//jQuery("#inviteMessages").html('successful call, but error! ' + data.message);
}
else
{
jQuery("#inviteMessages").html('successful request! ' + data.message);
}
},
error: function(xhr, status, msg)
{
//jQuery("#inviteMessages").html('unsuccessful call, error! ' + status + ' ' + msg);
}
}
);
//jQuery("#inviteMessages").html('Successful request! Request ID = ' + response.request_ids);
}
else
{
//jQuery("#inviteMessages").html('Request failed!');
}
}
);