Facebook JavaScript API: Invite facebook friends

This is the JavaScript code to invite facebook friends (Posting message to their wall)

function inviteFBFriend(friend_id,invitation_message){
var opts = {
             message : invitation_message,
             name : 'Hello User',
             description : 'Facebook is great!',
             picture : 'http://www.knowledgeserve.in/images/knowledgeServeLogo.jpg'

FB.api('/'+friend_id+'/feed', 'post', opts , function(response) {
       if (!response || response.error) {
        alert('Error occured');            
       } else {
           alert('Post ID: ' + response.id);



  1. I think its a new revolution in online promoting techniques. Thats Gr8

    Interview Questions


Post a Comment

Popular posts from this blog

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Struts 2 - struts tag with boolean property