开发者

Facebook Like - Fanpage not current URL with API

开发者 https://www.devze.com 2023-03-11 16:07 出处:网络
Currently I\'m hitting the API through the JS SDK.What I am trying开发者_开发百科 to do is accomplish is having a like button on my website.But rather than liking the URL you are on..like the fan page

Currently I'm hitting the API through the JS SDK. What I am trying开发者_开发百科 to do is accomplish is having a like button on my website. But rather than liking the URL you are on..like the fan page. Is this possible?


Yes, it is possible.

With the iframe version: you would assign the href value to the URL you'd want to like. In your case, the url of the facebook fan page.

<iframe src="http://www.facebook.com/plugins/like.php?href=YOURURLHERE&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=21&amp;locale=en_GB" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:75px; height:21px;" allowTransparency="true"></iframe>

Just make sure you escape the characters in the url correctly. For example:

http://www.facebook.com/yourpage

would become:

http%3A%2F%2Fwww.facebook.com%2Fyourpage

0

精彩评论

暂无评论...
验证码 换一张
取 消