Log in

View Full Version : Facebook follow bottom



brokensaga0001
03-07-2015, 09:48 AM
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!!!

<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>



<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-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>

Beverleyh
03-07-2015, 10:48 AM
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;

<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.

STintin
03-13-2015, 08:20 AM
you need to add below Facebook sdk code inside 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/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


<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>