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 7781383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:12:40+00:00 2026-06-01T19:12:40+00:00

I am currently doing some work on a research database where they have decided

  • 0

I am currently doing some work on a research database where they have decided that they want to be able to share links to articles from the site on social networks (Facebook, Twitter, LinkedIn and Google+).

Preferably this should be done through the share buttons provided by the respective networks. I quickly got the buttons working and displayed correctly on the site by following the implementation instructions from each network.

My problem is a consequence of that the site offers the possiblity to show 1000 (1K) post on a single search result page. This means that when such a page is created it needs to create 1000 share buttons for each social network (effectively 4000).

Sadly this seems to overwhelm the browser as it offers to stop the javascript provided by the social networks and whether you choose to stop it or not – the page ends up in deadlock waiting for a response from the social networks and never finishes the page loading process.

I have an idea that the problem may be that the large number of asynchronous requests means that the browser somehow misses some of the responses and thus ends up waiting forever for a response that will never come.

As mentioned it is only a problem with such a large number of posts, if a page for example displays 100 posts (effectively 400 share buttons) it works perfectly.

While it could be argued that 1000 post on a single page is overkill, limiting the maximum number of displayed post is sadly not an option.

My question therefore is whether any of you know of a way to solve this kind of problem or if my only real option is to create custom share buttons that doesn’t need to be created through the javascript provided by the social networks ?

The following references leads to the documentation for each of the share buttons.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • 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-01T19:12:41+00:00Added an answer on June 1, 2026 at 7:12 pm

    For all these buttons, there is a main js file which does the heavy work.
    So, for LinkedIn, add the script tag:

    <script src="//platform.linkedin.com/in.js" type="text/javascript"></script> 
    

    once in the page. And use the below script as a placeholder for your linkedin button whereever you need it. (don’t forget to replace the data-url attribute in below script)

    <script type="IN/Share" data-url="http://developer.linkedin.com/plugins/share-plugin-generator" data-counter="top"></script>
    

    For Twitter similarly, the below script tag needs to be added once in the page as it’s job is to get the main js file and add it to the page.

    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    

    The below script needs to be added multiple times whereever you want. Replace the data-url attribute with your url which needs to be tweeted when you click on it.

    <a href="https://twitter.com/share" class="twitter-share-button" data-url="https://dev.twitter.com" data-via="your_screen_name" data-lang="en">Tweet</a>
    

    When you get the code for FB or Google Plus like, you will get a script which needs to be added once and then the code to be added where ever you need.

    EDIT:
    Based on your comment below: The scripts will surely cause issue because they need to convert each and every placeholder into a good looking ‘like’ button. Below are few ways to improve the performance:

    1. run these scripts only on page load (i.e., add the main scripts at load time)
    2. using setTimeout or setInterval, work on every 100 placeholders at a time (requires change in main scripts)
    3. Lazy load the init of like buttons. When the user scrolls the page and the like buttons will show up in the page, then initialize the buttons (requires change in main scripts)
    4. Recommended Approach: Keep just one set of like buttons. When user hovers over a search result, then add this set of buttons to that div and change the attributes related to url in the buttons. With this way, only one set of buttons will be shown and won’t take time at all to init them.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're currently doing some Word automation, and want to be able to insert a
I am currently doing some work for a company that runs a legacy web
I've been doing some work testing web applications with Cucumber and I currently have
I am doing some PloneFormGen work. Currently PloneFormGen stores entered form entries internally as
I am doing some performance critical work in C++, and we are currently using
I am currently doing some socket programming using C/C++. To be able to use
I'm doing some research for my project where I'm gone have a shopping cart.
I call obackgroundworker.CancelAsync(); on a background worker currently doing some work in another thread
I am doing some research on language implementations on multicore platforms. Currently, I am
I'm doing some research work into content aggregators, and I'm curious how some of

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.