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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:52:45+00:00 2026-05-26T14:52:45+00:00

I saw this link here: How to detect Facebook share success? with Javascript But

  • 0

I saw this link here:

How to detect Facebook share success? with Javascript

But how do I implement that?

  • 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-05-26T14:52:46+00:00Added an answer on May 26, 2026 at 2:52 pm

    First you need to have the Javascript SDK loaded in your page

    <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : 'YOUR_APP_ID', // App ID
          status     : true, // check login status
          cookie     : true, // enable cookies to allow the server to access the session
          oauth      : true, // enable OAuth 2.0
          xfbml      : true  // parse XFBML
        });    
    
      };
    
      // Load the SDK Asynchronously
      (function(d){
         var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
         js = d.createElement('script'); js.id = id; js.async = true;
         js.src = "//connect.facebook.net/en_US/all.js";
         d.getElementsByTagName('head')[0].appendChild(js);
       }(document));
    </script>
    

    Next you have a function that contains the FB.ui code for opening the share dialog. Within the FB.ui function you can see where the callback starts function(response) {, where ‘response’ contains some details that help you determine if the user did share the message.

    In the callback we do an IF statement. If the user did post the message response.post_id exists and contains the id of the successfully posted message so then we can do whatever we want, in this example an alert pops up saying ‘Post was published’

    function share(){
      FB.ui(
        {
          method: 'feed',
          name: 'Facebook Dialogs',
          link: 'http://developers.facebook.com/docs/reference/dialogs/',
          picture: 'http://fbrell.com/f8.jpg',
          caption: 'Reference Documentation',
          description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
          message: 'Facebook Dialogs are easy!'
        },
    
        function(response) {
          if (response && response.post_id) {
    
            // THE POST WAS PUBLISHED
            alert('Post was published.');
    
          } else {
    
            // THE POST WAS NOT PUBLISHED
            alert('Post was not published.');
    
          }
        }
      );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a javascript/canvas game and I saw this example on CSS Tricks. Here's
Apple presented new iPad that support retina graphics. I saw this link retina graphic
After reading this question , i saw the answer by Naveen containing a link
I saw this same question for VIM and it has been something that I
Is this even possible, few argue its possible and i saw it here too
I don't do much PHP but I saw this library called, Tank Auth for
I saw many similar questions here but their answers don't work for me by
I saw very interesting example of using html5 css3 and javascript that is amazing,
I saw some topics here regarding facebook and twitter integration with Android Application. I
Actually i am using server side validation and saw article that only adding link

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.