Viewing Adding facebook Like Box HTML5

Adding facebook Like Box HTML5



User: CompuPal 12 years ago
What's the best way to add a Facebook Like Box with html5. I tried HTML snippet and did not work for me. I placed the first part of the code to the head and the second code to footer with no results.

Include the JavaScript SDK on your page once, ideally 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_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-box" data-href="https://www.facebook.com/compupal.net" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="true" data-show-border="true"></div>

Thanks
Rafael
User: Roddy 12 years ago
The div class="fb–like–box" should go into an HTML Snippet and the rest of the code into the footer code box in the page inspector if you only want the button on one page of the site.

Note: in this line - js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; - you need to add "http:" to make the URL …

http://connect.facebook.net/en_US/all.js#xfbml=1

When you are dealing with code, always test the URLs in the browser.

-------------------------------
Roddy

Website: http://everwebwidgets.com
Contact: http://everwebwidgets.com/ewWidgets-home/contact.html
NOTE: I am an EverWeb user and NOT affiliated with EverWeb! Any opinions expressed in this forum are my own.


Post Reply
You must login or signup to post.