1st please don't mark my question as a duplicate one because I read all the questions related but none of the questions stated my hint.
I was trying to make a facebook like button and found that facebook like box is more what I need because it just like and doesn't show any post after like.
The idea is when I take the code from the like box plugin link it doesn't add the like to the facebook page as other said that it was a bug in the facebook like. But when I press the button inside that link it will add the like to the facebook page.
The question is if it is a facebook bug should they state the first field as "Facebook Page URL" and should it work in the plugin link while you are configuring the like box before you get the code???
In other words, if it work in the plugin link so it must work if you get the code and paste it in your site, or am I wrong??
I've tried the HTML5, XFBML and IFRAME code that the facebook generate for you according to the data you provide.
No one of the below codes work; It shows the like box and when you click it will change to grey color but it doesn't make a like to the facebook page and when I refresh the test page it returns to the default state. When I was trying I found that the if I like the page from facebook site in normal way and try to dislike using the below code fro test page it will work.
EDIT:
While I am still trying to find a solution I found that in explorer works sometimes while in chrome and firefox doesn't.
I am using a test.html file that is placed in htdocs of xampp to test the result.
HTML5 code tried:
<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_GB/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/FacebookDevelopers" data-width="150" data-height="100" data-colorscheme="light" data-show-faces="false" data-header="false" data-stream="false" data-show-border="false"></div>
</body>
</html>
XFBML Code tried:
<html xmlns:fb="http://ogp.me/ns/fb#">
<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_GB/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:like-box href="http://www.facebook.com/FacebookDevelopers" width="150" height="100" colorscheme="light" show_faces="false" header="false" stream="false" show_border="false"></fb:like-box>
</body>
</html>
and the Iframe Code tried:
<html>
<head></head>
<body>
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2FFacebookDevelopers&width=150&height=62&colorscheme=light&show_faces=false&header=false&stream=false&show_border=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:150px; height:62px;" allowTransparency="true"></iframe>
</body>
</html>
Related
there's a problem at installing the new facebook page plugin. I create a simple test.html file with the following code including the plugin-code from https://developers.facebook.com/docs/plugins/page-plugin. But there is an error message from my browser that file://connect.facebook.net/de_DE/sdk.js#xfbml=1&version=v2.4 cannot find on the server. I also completed the adress by http: or saved the Facebook-file local and embedded it as a local js-file, but the page plugin doesn't appear. What's the problem?!
HTML-Code in test.html:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</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/de_DE/sdk.js#xfbml=1&version=v2.4";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-page" data-href="https://www.facebook.com/facebook" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-show-posts="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/facebook">Facebook</blockquote></div></div>
</body>
</html>
You do not appear to be including an App ID in your URL for the SDK request. If you have not yet created an App ID, you can do so here: https://developers.facebook.com/apps
Note the appended &appId=[APP_ID_NUMBER_GOES_HERE] in the example below from my Website (real App ID removed, obviously)
js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&version=v2.4&appId=[APP_ID_NUMBER_GOES_HERE]";
The Facebook SDK quick start guide and documentation should answer any other question you have about getting started: https://developers.facebook.com/docs/javascript/quickstart/v2.4
Ok managed the problem. The only thing I had to do is uploading my site to an online server.
I have tried using the code in Facebook Developers but it's not working when I try getting my post's comments. Anyone have tried this recently? I read in some forums that the code they used may be outdated, and when I tried it, it didn't solve my problem
I have tried two codes:
Code 1:
<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.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="https://www.facebook.com/cielomuyot/posts/903985589615702" data-numposts="5" data-colorscheme="light"></div>
</body>
</html>
Code 2:
<html>
<head>
<meta property="fb:app_id" content="{YOUR_APPLICATION_ID}">
</head>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1">
</script>
<body>
<div id="fb-root"></div>
<fb:comments href="https://www.facebook.com/cielomuyot/posts/905033959510865"></fb:comments>
</body>
</html>
This is not possible. The Comments Plugin is completely unrelated to Facebook posts. The href parameter is more or less just an id to get different comment plugins on one page.
That means, it does not make any sense to use a facebook.com URL as href parameter, always use the URL where you implement it (with a get parameter if you need more than one Comment Plugins on one page).
I am trying to add facebook facepile plugin to a page. I am trying to use news.reads action in the plugin and it doesn't work.
I am adding:
div class="fb-facepile fb_iframe_widget" data-action="news.reads" data-href="url-with-article" data-max-rows="1" data-width="200"
I understand that if I put news.reads action here I should be able to display images of friends who have read this article
I found that simply using the Facepile plugin on an Object that had users interacting via read actions automatically showed users that had read the object.
Specifying news.read as the data-action actually made the plugin cease to function.
Make sure you have initialized the Javascript with your app id:
<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=0&appId=YOUR_APP_ID";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Also, read the section called "Why is nothing displaying?" here: http://developers.facebook.com/docs/reference/plugins/facepile/
If all else fails, try the IFRAME version and see if you get any results there.
<iframe src="//www.facebook.com/plugins/facepile.php?href=url-with-article&action=news.reads&size=medium&max_rows=1&width=200&colorscheme=light&appId=YOUR_APP_ID" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px;" allowTransparency="true"></iframe>
I want to add a Facebook like button in my website.
If I use the following code like button is working but on log in the error message : "An error occurred with Facebook Platform Opt In. Please try again later" is displayed.
<html>
<head>
<title>My Great Web page</title>
</head>
<body>
<iframe src="http://www.facebook.com/plugins/like.php?href=guiuiu"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>
</body>
</html>
Why this is happening. Do I need to create a fb API for successful login?
you must provide a valid url in order to work with the iframe method.
Anyway - you better use the xfmbl implementation of the like button
in order to do that you will have to open application (on http://developers.facebook.com/apps)
then paste this code after the <body> tag of your page (put the APP ID where it belongs)
<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=APP_ID_GOES_HERE";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
add this namespace to your html node:
<html xmlns:fb="http://ogp.me/ns/fb#">
and put this instead of the iframe you used
<fb:like send="false" href="YOUR_PAGE_ABSOLUTE_URL" width="450" show_faces="true"></fb:like>
for any further information you may refer here:
http://developers.facebook.com/docs/reference/plugins/like/
The accepted answer is wrong.
You'll get the same error the OP described no matter what implementation you use. The issue is due to a bug on Facebook's side of things.
It's currently OPEN, ASSIGNED, and set to HIGH priority. See here for more details: http://developers.facebook.com/bugs/228506407275556
I have created a page "Education For All" in facebook. In my website i want to provide a like button to like this page not the url and also want to show the count of the Likes received for that page in website along with Like button. I have used "Add this", but it is showing the count of number of likes for the url. Can you suggest me any plugin ?
Any help will be appreciated...
generate your facebook like button from here,
http://developers.facebook.com/docs/reference/plugins/like/
Please provide proper informations to get the proper code, or you can use the code below by following the instructions, just replace http://www.yoururl.com with the desired URL of the page which needs to be liked:-
1. Include the JavaScript SDK on your page once, ideally right after the opening 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_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Place the code for your plugin wherever you want the plugin to appear on your page.
<div class="fb-like" data-href="http://www.yoururl.com" data-send="true" data-width="450" data-show-faces="true"></div>
Have you already tried to generate the like button through https://developers.facebook.com/docs/reference/plugins/like/ ?
It gives you this code for example:
<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fedforall&send=false&layout=standard&width=450&show_faces=false&action=like&colorscheme=light&font&height=35&appId=225116190942635" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>