View Single Post
Old 11-23-2012, 10:19 PM   PM User | #4
jimutt
New Coder

 
Join Date: Sep 2011
Posts: 47
Thanks: 1
Thanked 15 Times in 14 Posts
jimutt is an unknown quantity at this point
This solution has been working for others:
Code:
$('#likebutton').click(function(){
    $.ajax({
       type: 'POST',
       url: 'https://graph.facebook.com/OBJECT_ID/likes?method=POST&format=json&access_token=TOKEN,
       success: function(res) {
          // do something like style button
        }
    });
});
The reason why it doesn't work for you when you copy the URL it's because the actual "like" is sent by an AJAX request and it's not sent by just sending the user to a specific URL.

I got the code example from this StackOverflow question: http://stackoverflow.com/questions/5...facebook-photo
jimutt is offline   Reply With Quote
The Following 2 Users Say Thank You to jimutt For This Useful Post:
MrTIMarshall (11-24-2012), systems99 (11-27-2012)