-
Facebook follow bottom
Hi.. I have a school project to create web page and i wanted to add facebook follow me bottom but it is not working.. I copied the codes below but i have no idea how to use them and where..please help me!!!
Code:
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'your-app-id',
xfbml : true,
version : 'v2.1'
});
};
(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";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
Code:
<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>
Code:
<div class="fb-follow" data-href="https://www.facebook.com/skperfect" data-width="80" data-height="80" data-colorscheme="dark" data-layout="standard" data-show-faces="true"></div>
-
I don't personally use Facebook (or other social media) button scripts like these because of the extra weight they add to a web page. For example, when I removed the Like button from one of my websites, it improved load time by almost half a second, it cut 6 HTTP requests, and cut 73kb weight. That was a while ago so I can't actually remember the script that I removed (a copy+paste job from years before, when the code looked a lot different) but maybe you could switch to the same faster/lighter method of linking to Facebooks "sharer" script, like I did?
Below is the markup for the faster/lighter alternative. It goes in the <body> with all your other markup - replace the URL on the end with your website and use your own facebook icon;
Code:
<a href="http://www.facebook.com/sharer.php?u=http://www.mywebsite.com"><img src="facebook-icon.png"></a>
Going back to your post, what you've posted appears to be 3 separate batches of code - I'm guessing that you've copied and pasted them from a tutorial of some kind, so if you still want help in using the official Facebook script, it would be helpful if you post a link to the article/tutorial that you got these from along with a link to your page. Follow, share, like -- I don't know the difference between them all but maybe somebody who does can help you.
-
you need to add below Facebook sdk code inside body tag
Code:
<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>
add above code just before </body>
and then add Facebook like or follow button wherever you want to your buttons to render in your website.
http://www.shoutingblogger.com/2013/01/add-facebook-like-button-in-blogger.html
Code:
<div class="fb-follow" data-href="https://www.facebook.com/skperfect" data-width="80" data-height="80" data-colorscheme="dark" data-layout="standard" data-show-faces="true"></div>