Today, i created an iframe-Tab on our Facebook Page as a landingpage. On this tab we display a video, implemented from Facebook.
Now i want to add the Facebook Like Button for this video on this page, i implement the code generated by the LIKE BUTTON Developer Page.
<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fvideo%2Fvideo.php%3Fv%3D345848348745&layout=button_count&show_faces=true&width=100&action=like&font=arial&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:120px; height:21px;" allowTransparency="true"></iframe>
Now the button where displayed, but without a count. If i click on the like button the counter getting visible (displaying +1) and jumping back then (displaying no count).
Do you kno开发者_运维知识库w, if i can use the like button directly for the Facebook URL? http://www.facebook.com/video/video.php?v=345848348745
Thank u!
See the below code for an example implementation of a LIKE button that works in all browsers.
HTML:
<iframe id="IframeTemp" src="#" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:55px;" allowTransparency="true">
</iframe>
JavaScript:
<script type="text/javascript">
var currenturl = document.URL + "&send=false&layout=standard&width=450&show_faces=true&action=like&colorscheme=light&font&height=55";
var url = "//www.facebook.com/plugins/like.php?href="+currenturl;
document.getElementById("IframeTemp").src = url;
var myIframe = parent.document.getElementById("IframeTemp");
// Setup the width and height
myIframe.src = url;
</script>
Don't forget to keep the Javascript on the master page which is available in developer Facebook.
I had the same problem you did on a project I'm working on. I've found that you can "like" the url for the actual video file, in your case http://www.facebook.com/v/345848348745
however, the problem with this solution is that the likes will not aggregate onto the actual video page's url. They will be two separate "like' entities
This seems to be a limitation of the fb like functionality at the moment I'm afraid
精彩评论