Search code examples
javascriptfacebookfacebook-social-plugins

Fb share functionality not working


I have created facebook share button functionality in wordpress.everithing works fine for me. if any one other than me tries to share it produce following error message in console.

 .d8888b.  888                       888    
d88P  Y88b 888                       888    
Y88b.      888                       888    This is a browser feature intended for 
 "Y888b.   888888  .d88b.  88888b.   888    developers. If someone told you to copy-paste 
    "Y88b. 888    d88""88b 888 "88b  888    something here to enable a Facebook feature 
      "888 888    888  888 888  888  Y8P    or "hack" someone's account, it is a 
Y88b  d88P Y88b.  Y88..88P 888 d88P         scam and will give them access to your 
 "Y8888P"   "Y888  "Y88P"  88888P"   888    Facebook account.
                           888              
                           888              
                           888              

For more information, see https://www.facebook.com/selfxss.

can anyone tell me how to fix this

edit my code

<div id="fb-root"></div>

<script>
  window.fbAsyncInit = function() {
     FB.init({appId: '1382611775340903', status: false, cookie: false, xfbml: false});
  };

  (function() {
     var e = document.createElement('script'); e.async = true;
     e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
     document.getElementById('fb-root').appendChild(e);
  }());
</script>

<a class="action_button" onclick="share(event)" href="javascript:void(0)" id="fb_share" target="_blank"> share this</a>

<script type="text/javascript">
function share(e){
e.preventDefault();
FB.ui(
{
method: 'feed',
name:'<?php echo get_the_title(); ?>',
link: 'http://iseastest.juzzstaging.com/',
picture: '',
caption: 'This is the content of the "caption" field.',
description: 'This is the content of the "description" field, below the caption.',
message: ''
});
}
</script>                                                                                    screen shot![see screen shot][1]

Solution

  • Go to Status & Review section of your facebook app, and see it's showing Yes for Do you want to make this app and all its live features available to the general public?. If not, you have to submit this app for review after filling mandatory informations under App Details section.

    You should provide app description, logo, contact email.