在用户分享链接后显示隐藏的下载框

Show hidden download box after user shares a link

本文关键字:隐藏 下载 显示 用户 分享 链接      更新时间:2023-09-26

我试图使一个隐藏的下载框div出现在访问者分享链接后。我已经尝试过这里的东西http://jsfiddle.net/trefu/qNDJB/4/但不工作。我不知道如何定义FB,所以它可以被调用。有人能帮帮我吗?

 <div id='fb-root'></div>
<div id="download_box" style="display: none;">
    Download Box (whatever that means) goes here
</div>
  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);
  }

看一看wowvi.blogspot.ro:

var cc = '<iframe allowfullscreen='true' frameborder='0' height='410' src='embed.php?id=http://www.youtube.com/watch?v=Zcg8xscHkXM' width='640'></iframe>';

更改为

var cc = "<iframe allowfullscreen='true' frameborder='0' height='410' src='embed.php?id=http://www.youtube.com/watch?v=Zcg8xscHkXM' width='640'></iframe>";