I am trying to make a plugin in my website just like this one :
I am using this code. It includes the script :
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
and this :
<div class="fb-like" data-href="htpp://www.my-site.com/" data-width="600" data-height="30" data-colorscheme="light" data-layout="standard" data-action="like" data-show-faces="true" data-send="true"></div>
but nothing shows up. Do I have to use css or a js link included in my page to make it work?
I think you are missing the appId. Make sure to create a Facebook application and connect it with your plugin.
Related
I want to add a like button to my website but I'm having trouble doing so.
After some research I found this code that has to be right after the opening body tag:
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.9";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
and with it comes this code that goes where I want my like button in the page:
<div class="fb-like"
data-href="http://www.facebook.com/curlybracketssarl"
data-width="200" data-layout="standard" data-action="like"
data-size="small" data-show-faces="true" data-share="false"></div>
Yet nothing is showing, I even tried to do so in a blank page and got no results once again.
So can you kindly tell me how to do what I need to do?
i'm terribly stacked into this silly situation where i cannot make the standard Facebook Like Button plugin to work.
I'm using the default code that Facebook suggests with no luck:
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=189637597750754&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
and have the classic elements as well:
<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
Here is a demo
I really cannot figure out what is wrong with it.
Here is code for like box we need to add comment box and like box in each post...
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like-box" data-href="http://www.facebook.com/OneLife4Live" data-width="600" data-height="400" data-colorscheme="light" data-show-faces="false" data-header="flase" data-stream="true" data-show-border="true">
</div>
you keep logged in facebook on another tab.
you will get Likebox and commentbox directly when you facebook logged in browser.
as the title says, I found out my like box not appearing unless I am logged in facebook
Back in the past it was not like this
On some websites, I see the like box showing up even if I am not logged; I checked the code, and what differs from mine is that they have an AppID
Could someone please explain this to me?
if you are using an AppID your Check your application not running in sandbox or development mode
here is a sample of your like button code
<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
I currently have a Like-Box that is only visible while I'm in Safari on my MacBook.
The following are unable to view the like-box (that I have tested so far):
Chrome,Safari (mobile) (iPhone4,4S,5,iPad), Firefox
Is functionality restricted to a certain Java setup? I pulled the code directly from Facebook and have included the Java as they recommend.
Thanks in advance!
Code in question:
Facebook-supplied block:
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=MYAPPID";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
LikeBox:
<div class="fb-like" data-href="https://www.facebook.com/pages/MyPage/MyID" data- send="false" data-width="60" data-show-faces="true"></div>
</div>
Please Note that I have deidentified my Page and ID, thanks.