Hi I am trying to add a facebook like button to a website of mine but nothing seems to apear I've checked about a dozen tutorials and Im doing exactly what is being said there and the facebook button dosent apear.On firefox it shows nothing but on chrome , IE9 , opera and safari I get a this page can not apear error:
This is the link I'm using to generate the code:
http://www.facebook.com/pages/WillKode/228217780608588
And this is a test page i've created:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FWillKode%2F228217780608588&send=false&layout=standard&width=450&show_faces=false&action=like&colorscheme=light&font&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
</body>
</html>
Are you testing just a local HTML file? It seems to work for me: http://jsfiddle.net/jhchen/D8pgg/.
Try to change the iframe src to https://www.facebook.com instead of //www.facebook.com. It should be the latter (the way you already have it) but when testing locally the latter will not work.
Reason is // mean use the protocol of the document which is great security-wise because the iframe will use https://www.facebook.com if you are on an https page and http://www.facebook.com when you are on an http page but if you are just testing locally the protocol is file:// and file://www.facebook.com does not lead anywhere.
Related
I have a facebook fanpage: www.facebook.com/derwettprofi
I wanted to create a like box. Although I use the code generated by facebook it does not work. I created the following simple html page:
<HTML>
<BODY>
<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fderwettprofi&width=292&height=62&colorscheme=light&show_faces=false&header=false&stream=false&show_border=false&appId=567203116676137" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:62px;" allowTransparency="true"></iframe>
</BODY>
</HTML>
But when called in the browser it looks like this:
I do not understand what is happening? The response is empty. Why does it not work?
You need to put the http:// in front of www. This happened to me as well
it is because your website is on localhost. Try uploading it to an online host, that should solve your problem.
Not sure why. I grabbed the code from:
http://developers.facebook.com/docs/reference/plugins/like/
And as stated there, we can read:
"href - the URL to like. The XFBML version defaults to the current
page. Note: After July 2013 migration, href should be an absolute URL"
So I did.
<body>
<div>
<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fprojectokairos&width=100&height=21&colorscheme=light&layout=button_count&action=like&show_faces=false&send=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
</div>
</body>
Could this be related with the fact that the page is unpublished?
I hope not because I do need to place the button here and there on several pages before the FB page goes live.
Being unpublished is possible, but I would also check your plugins. Firefox and Chrome especially. Do you have AdBlockPlus, DoNotTrackMe, or NoScript installed? The last two, I know interfere with the Facebook like button.
I have put a facebook like box on a website i've created, and on my computer it all works fine (safari, chrome, firefox, ie, ...)
But when some of my friends open the website in safari, de box won't show to everybody.
(so some friends can see it in safari, with others it just won't show/appears and disappears immediatly/...)
Here's the iframe-code i've included
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FLuca-Barassii%2F126244157780&width=300&height=340&colorscheme=dark&show_faces=true&border_color&stream=false&header=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:340px;" allowTransparency="true"></iframe>
hope anyone can help me... :)
This is most likely due to their version of Safari. This browser's webkit had problems interpreting ampersands in urls in a previous version, encoding the & to & instead of & in xhtml pages. This was fixed in a later Webkit.
But to make sure, you can encode your iframe url yourself:
<iframe src="//www.facebook.com/plugins/likebox.php?
href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FLuca-Barassii%2F126244157780
&width=300&height=340&colorscheme=dark&show_faces=true
&border_color=&stream=false&header=false"
scrolling="no"
frameborder="0"
style="border:none; overflow:hidden; width:300px; height:340px;"
allowTransparency="true">
</iframe>
This would not have stopped the box from not showing in specific (older) versions of Safari though, because the ampersands would still have been encoded incorrectly.
I want to put "like" button of facebook in my website, I use this
<html>
<head>
<title>My Great Web page</title>
</head>
<body>
<iframe src="http://www.facebook.com/plugins/like.php?href=https://www.google.com.sg/"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>
</body>
</html>
however, it doesn't work if I haven't log into facebook, what't the problem?
and how to implement the same function in twitter?
There is generators for both Twitter and Facebook integrations available for free at the corresponding company's webpage.
However, as you've already written, it will only work when logged in. When you are not logged in it'll display a login page for facebook, see here for a working jsfiddle with your code:
http://jsfiddle.net/Y5WAp/
And here for a screenshot of what happens (and SHOULD happen) when I try to like without being logged in to facebook:
http://i.imgur.com/U2Tgz.png
hi there i am a student and practicing how to place the like box plugging code in simple html using the notepad,
here is the simple code i write with the like box plugging code:
<html>
<head>
<title>My Great Web page</title>
</head>
<body>
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Febitesblog&width=292&colorscheme=light&show_faces=true&border_color&stream=true&header=true&height=590" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:590px;" allowTransparency="true"></iframe>
</body>
</html>
and when i try to execute in browser it says:
This webpage is not found
No webpage was found for the web address:
file://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Febitesblog&width=292&colorscheme=light&show_faces=true&border_color&stream=true&header=true&height=590
Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found
hope guys it will fix my problem thank you :)
It's failing because the // in that is protocol relative meaning it loads the link/photo/like box/whatever using the same protocol used to access the page itself.
When accessing the page over HTTP (http://), the Like Box will be included over HTTP
When accessing the page over HTTPS (https://), the Like Box will be included over HTTPS
You're accessing a file on localhost, via the file protocol (file://) - which means it tries to include the Like box the same way, which is not valid since there isn't a file on your machine called 'www.facebook.com`
Use <iframe src="https://... now, and change it back to <ifame src=//... when you're uploading to your server
<iframe src="//www.facebook.com/plugins/likebox...
should be...
<iframe src="https://www.facebook.com/plugins/likebox...