How to implement the Facebook "Like" button to your site without using iframe and FBML?
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>
精彩评论