Results 1 to 3 of 3

Thread: Facebook follow bottom

  1. #1
    Join Date
    Mar 2015
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation 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>
    Last edited by Beverleyh; 03-07-2015 at 10:49 AM. Reason: Formatting

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    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.
    Last edited by Beverleyh; 03-07-2015 at 10:55 AM.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Mar 2015
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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>
    Last edited by james438; 03-14-2015 at 04:40 AM. Reason: format

Similar Threads

  1. Trying to follow a script from this site.
    By theremotedr in forum Dynamic Drive scripts help
    Replies: 18
    Last Post: 08-03-2012, 11:20 AM
  2. Facebook bottom bar.
    By ipuck in forum Looking for such a script or service
    Replies: 12
    Last Post: 05-17-2010, 08:22 PM
  3. Facebook Bottom Bar
    By coinslab in forum Looking for such a script or service
    Replies: 1
    Last Post: 07-13-2009, 05:55 AM
  4. Backscroll: images do not follow after another
    By potklei in forum JavaScript
    Replies: 0
    Last Post: 06-07-2008, 10:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •