【问题标题】:Trouble linking to images on localhost in a post from a Facebook application在 Facebook 应用程序的帖子中链接到本地​​主机上的图像时遇到问题
【发布时间】:2011-05-12 19:27:12
【问题描述】:

我使用以下代码在我刚刚启动的 Facebook 应用中发布到用户墙:

    FB.ui(
{
 method: 'feed',
 name: 'Facebook Dialogs',
 link: 'http://developers.facebook.com/docs/reference/dialogs/',
 picture: 'http://localhost:8888/project_images/110/110.png',
 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) {
   alert('Post was published.');
 } else {
   alert('Post was not published.');
 }
}
);

遗憾的是,即使当我在浏览器中输入:http://localhost:8888/project_images/110/110.png 时,图像显示没有问题。此外,当我使用示例中的默认值:http://fbrell.com/f8.jpg 作为图片:参数时,图像显示得很好。由于本地主机,这不起作用吗?我在 MAMP 上运行 localhost。

【问题讨论】:

  • 今天发现了同样的问题 - 有什么解决办法吗?

标签: facebook localhost publish mamp


【解决方案1】:

我也遇到了这个问题。我认为这是因为 Facebook 尝试获取图像,但无法访问 localhost。

【讨论】:

  • 这正是正在发生的事情。 Facebook 缓存图片(并缩放它们)。这让他们可以托管来自 https 的内容(试试看:facebook.com
猜你喜欢
  • 2012-02-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-12
  • 2021-06-25
  • 2013-08-03
  • 2022-07-22
相关资源
最近更新 更多