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

  • Home
  • SEARCH
  • 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 9060305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:11:43+00:00 2026-06-16T15:11:43+00:00

I implemented the facebook share button in my page using javascript, like this: <script

  • 0

I implemented the facebook share button in my page using javascript, like this:

<script type="text/javascript">
$(document).ready(function(){
        $('#share_button').click(function(e){
            e.preventDefault(); 
            FB.ui(
            {
                method: 'feed',
                name: "{{ user_name }}'s FOF",
                link: "https://www.example.com/uploader/{{current_fof}}/share_fof/",
                picture: imgsArray[0].src,
                caption: window.location.href,
                description: 'This FOF was taken by {{ user_name }}',
                message: ''
            });     
        });
    });
</script>


<div class="share"> <img src = "{{ STATIC_URL }}images/share_facebook.png" id="share_button" type='button_count'></div>

It is working pretty well but now I’d like to put many posts within the same page and use a different share button for each post (very FB share button shall have a different link, title and image). Any ideas?

It worked with the like button, using the FB API:

<div class="fb-like" data-href="https://www.example.com/uploader/{{current_fof}}/share_fof/" data-send="true" data-layout="button_count" data-width="450" data-show-faces="false" data-font="arial"></div>  

But how to do a similar thing with the share_button? Any idea?

Cheers,

  • 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-16T15:11:44+00:00Added an answer on June 16, 2026 at 3:11 pm

    Give each of your “share” button a different id and alter the other options(different link, title and image) for each item.
    For example:

    <script type="text/javascript">
    $(document).ready(function(){
            $('#share_button1').click(function(e){
                e.preventDefault(); 
                FB.ui(
                {
                    method: 'feed',
                    name: "{{ user_name }}'s FOF",
                    link: "https://mysite.com/uploader/{{current_fof}}/share_fof/",
                    picture: imgsArray[0].src,
                    caption: window.location.href,
                    description: 'This FOF was taken by {{ user_name }}',
                    message: ''
                });     
            });
            $('#share_button2').click(function(e){
                e.preventDefault(); 
                FB.ui(
                {
                    method: 'feed',
                    name: "{{ user_name }}'s FOF",
                    link: "https://mysite.com/uploader/{{current_fof}}/share_fof/",
                    picture: imgsArray[0].src,
                    caption: window.location.href,
                    description: 'This FOF was taken by {{ user_name }}',
                    message: ''
                });     
            });          
            $('#share_button3').click(function(e){
                e.preventDefault(); 
                FB.ui(
                {
                    method: 'feed',
                    name: "{{ user_name }}'s FOF",
                    link: "https://mysite.com/uploader/{{current_fof}}/share_fof/",
                    picture: imgsArray[0].src,
                    caption: window.location.href,
                    description: 'This FOF was taken by {{ user_name }}',
                    message: ''
                });     
            });
    });
    </script>
    

    The buttons could be:

    <div class="share"> <img src = "{{ STATIC_URL }}images/share_facebook.png" id="share_button1" type='button_count'></div>  
    <div class="share"> <img src = "{{ STATIC_URL }}images/share_facebook.png" id="share_button2" type='button_count'></div>  
    <div class="share"> <img src = "{{ STATIC_URL }}images/share_facebook.png" id="share_button3" type='button_count'></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just put implemented Facebook connect on my web-site using the JavaScript SDK.
I've implemented the Facebook like button on my site, but liked links are showing
I have implemented the facebook share feature in JavaScript. So far, when i click,
I saw this link here: How to detect Facebook share success? with Javascript But
I have just implemented Facebook Authentication on my website using Facebook JavaScript. If user
I recently implemented the action-send intent to share a plain text. Facebook is installed
I had implemented facebook login in my project using javascript code. It was working
I want to implement a share function like the camera app is using. final
I have implemented Facebook Connect into a HTML page exactly as the tutorial explains
i want to add a facebook share button to my mobile web app for

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.