Reputation: 2325
I use the follwing code to display Facebook Like button, but I havn't got result, why?
The code is copied from FaceBook, it seems that the code lost http:
Thanks!
<html>
<head>
<title>My Great Web page</title>
</head>
<body>
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.hicalc.com%2F&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>
Upvotes: 0
Views: 573
Reputation: 90852
The omission of http:
is intentional, valid and correct. It means that it will be on the same protocol that you are on.
http://example.com
, it'll use http://www.facebook.com
https://example.com
, it'll use https://www.facebook.com
file:///example
, it'll use file://www.facebook.com
This last is what I imagine is tripping you up; it won't work on a local file.
Either (a) use a local web server so that it's http://localhost
(a good idea as it removes the potential for various security restrictions and problems and makes the development environment more like the deployment environment) or (b) prepend http:
while it's in development (try to remove it for deployment).
Upvotes: 1