Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8034711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:06:20+00:00 2026-06-05T02:06:20+00:00

I am to implement social network buttons on some one’s website. I am hoping

  • 0

I am to implement social network buttons on some one’s website. I am hoping to do it as easily as possible AND futureproof so that the customer doesn’t need to add anything when he creates a new page. All his pages are HTML (not PHP) so I can’t use any PHP. I was thinking of JS and then using jQuery’s .append to make it all nice and easy, but I was wondering whether there is a better way and/or this method has any flaws? Here is the code:

HEAD (scripts):

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>$(document).ready(function() {
    var currentURL = window.location; //Get the URL, put it in a variable

    $('#fb').append('<div class=\"fb-like\" data-href=\"' + currentURL + '\" data-send=\"true\" data-width=\"450\" data-show-faces=\"true\" data-font=\"arial\"></div>');
});</script>

BODY

<body>
    <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_GB/all.js#xfbml=1&appId=177213782346727";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
    </script>

    <div id="fb">Test</div>
</body>

Any remarks on that? I don’t want to fully implement this and then have to change everything all over again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:06:21+00:00Added an answer on June 5, 2026 at 2:06 am

    Once in a while Google’s API Libraries go down for whatever reason.

    I think including a fallback method to load jQuery would be welcomed in the head section:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="js/jquery-1.7.1.min.js"><\/script>')</script>
    

    For the buttons themselves, animating them with open source jqDock might interest you which is based on JavaScript and jQuery and not CSS3. One of that site’s webpages is using a social-plugin from WordPress that you might want to look at. It shows a method similar to your DIV’s and JS but is different for the FB connection scheme. Perhaps a mashup method is in order.

    If jqDock is overkill, there’s a lot more nifty Social Button plugins and CSS/Animated tutorials to pick from which are direct in what they do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a social network that is wanting to implement a chat room for
I would like to build a website that has some elements of a social
I want to implement social buttons in my website. What is the best script
I'd like to implement a social network for students and teachers. I just can't
Given you have to implement a news feed like the one seen in social
I have seen some social network sites, if you have a user account, and
I'm developing android app. It's some sort of social network. Where user can add
I have a smaller web app that republishes content from one social source to
I need to implement in my social network application a customized membership, and add
I have a social network that has a blogs and questions section. There are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.