Newbie
Newbie

Reputation: 2825

Can I send dynamic messages with the Facebook send button?

I would like to allow my users to invite their friend through Facebook private message to earn some rewards. I am wondering if it is possible to do it using the facebook send button. Sadly I found that the send button can only send a static url (such as www.website.com). However, I'd like to append different arguments from person to person (such as www.website.com/invite.php?token=tk12345) to the url. Any ideas?

Upvotes: 1

Views: 458

Answers (1)

borisdiakur
borisdiakur

Reputation: 12082

With jQuery:

<script src="http://code.jquery.com/jquery-latest.js"></script>
<fb:send id="mysendbtn" href="www.website.com"></fb:send>
<script>
    $("#mysendbtn").attr("href", "www.website.com/invite.php?token=tk12345");
</script>

Upvotes: 3

Related Questions