facebook like button red error - facebook

I embed Facebook like button in my page, but the problem is that, when I login using the like button then the page is liked. But if I already logged in from another page or tab and I clicked the like button a red error is displayed and a message pops up that the message has been blocked by our security system.
My code to embed like button:
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title>Facebook Checker</title>
<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>
</head>
<body >
<div id="fb-root"></div>
<div class="fb-like" data-href="http://www.google.com" data-width="450" data-layout="button_count" data-show-faces="false" data-send="false"></div>
<script type="text/javascript">
</script>
</body>
</html>

Facebook Like detect suspecious Activity on Localhost. Make a forward account and forward your localy site and past the above code its Works Fine :)
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title>Facebook Checker</title>
<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>
</head>
<body >
<div id="fb-root"></div>
<div class="fb-like" data-href="http://www.google.com" data-width="450" data-layout="button_count" data-show-faces="false" data-send="false"></div>
<script type="text/javascript">
</script>
</body>
</html>

Related

facebook sdk dont show fb-page for my domain

when I post the following code on my web site it show fb-page correctly
<html>
<head>
</head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'XXXXXXXXXXXXXXX',
xfbml : true,
version : 'v2.10'
});
FB.AppEvents.logPageView();
};
(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/he_IL/sdk/debug.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-page" data-href="https://www.facebook.com/facebook" data-tabs="timeline" data-small-header="false"
data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-width="500" data-height="600">
<blockquote cite="https://www.facebook.com/facebook/" class="fb-xfbml-parse-ignore">
facebookc</blockquote></div>
</body>
</html>
However when I change the domain to mine it display a blank page, why ?
<div class="fb-page" data-href="https://www.facebook.com/my-domain" data-tabs="timeline" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-width="500" data height="600">
<blockquote cite="https://www.facebook.com/my-domain/" class="fb-xfbml parse-ignore">
my-domain</blockquote></div>
needless to say that https://www.facebook.com/my-domain works correctly
Thanks

Facebook Comments Moderation Tool not enabled

I have Facebook Comments on internal page - you have to login to see it. I configured it according to docs (I believe). Comments widget is displayed. I can add comments from different accounts and I can see them but there is no Moderation Tool button and comments are not shown on https://developers.facebook.com/tools/comments/ I tried 3 configurations. None worked for me. What am I doing wrong?
Configuration 1
In head
<meta property="fb:admins" content="facebook admins"/>
After opening body tag
<div id="fb-root"></div>
<script>
/* <![CDATA[ */
(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/pl_PL/sdk.js#xfbml=1&version=v2.6";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
/* ]]> */
</script>
Later on page
<div class="fb-comments" data-href="url to this specific article" data-width="100%"></div>
Configuration 2
In head
<meta property="fb:app_id" content="facebook app id"/>
After opening body tag
<div id="fb-root"></div>
<script>
/* <![CDATA[ */
(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/pl_PL/sdk.js#xfbml=1&version=v2.6&appId=facebook app id";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
/* ]]> */
</script>
Later on page
<div class="fb-comments" data-href="url to this specific article" data-width="100%"></div>
Configuration 3 (mix of both)
In head
<meta property="fb:app_id" content="facebook app id"/>
<meta property="fb:admins" content="facebook admins"/>
After opening body tag
<div id="fb-root"></div>
<script>
/* <![CDATA[ */
(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/pl_PL/sdk.js#xfbml=1&version=v2.6&appId=facebook app id";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
/* ]]> */
</script>
Later on page
<div class="fb-comments" data-href="url to this specific article" data-width="100%"></div>
Common app settings
Comments widget on my page when I (admin) am logged in
I had same problem. I also tried all combination.
Go to https://developers.facebook.com/tools/debug/
Paste the url.
The problem will be shown in "Warnings That Should Be Fixed"
I had a problem with app_id.
Also, you can specify either fb:app_id or fb:admins, but not both.

social media share specific content out of page

I am having some issue with my social media share code.
See my code below:
// I want to share this div (id="maindiv") at facebook on click of facebook share button...
<html>
<head>
</head>
<body>
<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&version=v2.5&appId=17968886776";
fjs.parentNode.insertBefore(js, fjs);
}
(document, 'script', 'facebook-jssdk'));
</script>
<div id="maindiv1" style="border:1px solid blue;width:500px;height:230px">
<div style="border:0px solid red;width:100px;height:80px;float:left;">
<img src="http://localhost:8080/pushnotification/img/small-icon.png" /><img>
</div>
<h1 style="color:blue;font-family:sans-serif;float:left;width:390px;margin-top:10;text-align:center;border:0px solid red;">enterployee.com</h1>
<div style="border:0px solid red;width:100%;height:120px;float:left;">
<p style="font-family:sans-serif;font-size:15px;">
Enterployee.com is a employee relationship management tool for enterprise. It’s a fully managed notification platform for employees.
We have a vision to make organizations more professional and organized. After getting an enterployee account organizations can notify their employees easily and employees can connect with their company in better way.
</p>
</div>
<div style="border:0px solid red;width:80px;height:30px;float:right;">
<div class="fb-share-button" data-href="http://localhost:8080/pushnotification/img/small-icon.png" data-layout="button"></div>
</div>
</div>
</body>
So the problem is that I have multiple jobs posting in my site and I need to add this share button to each individual divs, not the full page. I have done the coding for full page share but need help in sharing only some part of page or a div.
<div class="fb-share-button" data-href="y" data-layout="our urlherebutton"></div>
(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&version=v2.5";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

Facebook comment box not displaying

I have project in wordpress with magazine theme. I noticed the facebook comment box was not displaying on single.php page. when I viewed through 'View Page Source' the code was present even space was left for comment box between the article and advertisement. I checked css for display:none or any other thing that might have caused but no solution yet.
I am getting that div as
where data-href is coming as "./" Please help.
Working sample:
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title></title>
</head>
<body>
<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 = "https://connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:comments href="http://stackoverflow.com/" numposts="5" colorscheme="light"></fb:comments>
</body>
</html>

Facebook likes button integration

My requirement is I need to get like button of facebook in my application for each feed of facebook in a user's wall.
In click of like button, I should update the number of likes in facebook as well as in my application for a particular post. I am using below code but unable to achieve my requirement.
<html xmlns:fb="http://ogp.me/ns/fb#">
<body>
<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=297457613664288";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
//div class I am using
<div class="fb-like" data-send="false" data-width="450" data-show-faces="true"></div>
</body>
</html>
i this this should works:
<iframe src="http://www.facebook.com/plugins/like.php?href=Your App URL"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>