Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Facebook Invites JS
// FB invite data
var button, display, div, facebook_friend_id, ie, message, self;
message = 'Dan DeMeyere has invited you to join thredUP, an online marketplace where moms like you buy, sell & share children\'s clothes, toys and books online.';
facebook_friend_id = button.parent().attr('friend_uid');
// Detect browser and set the compatible Dialog display type
div = document.createElement('div');
div.innerHTML = '<!--[if IE]><i></i><![endif]-->';
ie = div.getElementsByTagName('i').length === 1;
if (ie) {
display = 'popup';
} else {
display = 'iframe';
// Make the call
method: "apprequests",
message: message,
display: display,
to: facebook_friend_id
}, function(response) {
facebook_request_id = response.request_ids[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment