Facebook分享按钮参数不能正常工作


Facebook Share button parameters don't work properly?

我使用这个API: http://developers.facebook.com/docs/share/在页面底部,他们提到了一种创建我们自己的按钮的方法。

我的代码是这样的:

<body>
    <?php    
    function encodeURIComponent($str) {
      $revert = array('%21' => '!', '%2A' => '*', '%27' => "'", '%28' => '(', '%29' => ')');
      return strtr(rawurlencode($str), $revert);
    }
    ?>
    <a href="http://www.facebook.com/sharer.php?u=<?php echo encodeURIComponent('http://www.google.com'); ?>&t=<?php echo encodeURIComponent('It is the google website'); ?>">Share this2</a>
  </body>

但是它不能正常工作!并且它总是在共享对话框中显示页面标题作为标题!

参见 Facebook共享器如何选择图像? from OffBySome可以比i更好地解释


节选自一些较好的答案:

在你的HTML的头部部分,你需要meta标签:

<meta property="og:title" content="title" />
<meta property="og:description" content="description" />
<meta property="og:image" content="thumbnail_image" />

你可能需要强制Facebook服务器清除缓存与Facebook Url调试器