开发者

How to implement the Facebook "Like" button to your site without using iframe and FBML?

开发者 https://www.devze.com 2022-12-27 23:27 出处:网络
I want to implement the Facebook \"Like\" button to my site, but I don\'t want to use FBML and iframe.

I want to implement the Facebook "Like" button to my site, but I don't want to use FBML and iframe. Is it possible to implement this button by using plain HTML + JavaScr开发者_开发百科ipt?

http://developers.facebook.com/docs/reference/plugins/like


I don't think there is any way to create a custom, non-iframe "Like" to a non-Facebook resource, because the object needs to exist in Facebook first to add a Like to it through the API.

You can add likes to Facebook objects using the Graph API, which could be implemented in any way you choose, through Facebook Connect. But this defeats some of the purpose of the social plugins, which is to not require the user to authenticate your site before allowing interactions.

If you were to do it through Facebook Connect you would first authenticate the user, then you would POST a request to http://graph.facebook.com/[objectid]/likes. The UI for this could be implemented in any way you choose.


Or you can also try this alternative :

http://openlike.org/

The implementation code should be something like :

<script type="text/javascript" src="http://openlike.org/v1/openlike.js"></script>
<script type="text/javascript">OPENLIKE.Widget()</script> 
0

精彩评论

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