0

我正在寻找在访问者分享链接后显示隐藏 div 的可能性,但我找不到任何东西。我在这里尝试了一些http://jsfiddle.net/trefu/qNDJB/9/但不起作用。有人可以给我一点帮助吗?

下载框(无论这意味着什么)去这里
window.fbAsyncInit = function() {
    FB.init({
      appId      : '437410746335629', // App ID
      channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML
    });

    // Additional initialization code here
  };

  // Load the SDK Asynchronously
  (function(d){
     var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     ref.parentNode.insertBefore(js, ref);
   }(document));




FB.init({appId: "437410746335629", status: true, cookie: true});

  function postToFeed() {

    // calling the API ...
    var obj = {
      method: 'feed',
      link: 'https://developers.facebook.com/docs/reference/dialogs/',
      picture: 'http://fbrell.com/f8.jpg',
      name: 'Facebook Dialogs',
      caption: 'Reference Documentation',
      description: 'Using Dialogs to interact with users.'
    };

  function callback(response) {
    if (response && response.post_id) {
        document.getElementById('download_box').style.display = 'block';
    } else {
        alert('You must share your post before you can download.');
    }
}

    FB.ui(obj, callback);
  }
4

1 回答 1

0

您指定的代码应该适用于您想要实现的目标。问题在于您的应用程序设置。确保您的域已在 Facebook 应用设置页面中设置,特别是更新“应用域”和“站点 URL”字段。您会发现您收到的提要对话框错误将得到解决。

于 2013-03-23T13:25:23.590 回答