Facebook分享按钮:它正式死了吗? [英] Facebook Share button: is it officially dead?

查看:23
本文介绍了Facebook分享按钮:它正式死了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自 7 月 17 日起,旧的分享按钮在我管理的所有网站上都停止工作.

Since July 17 the old share button stopped working on all the websites I manage.

我已阅读其他面临类似问题的用户的报告,但我找不到任何官方信息.

I've read reports by other users that are facing similar issues, but I was not able to find anything official.

你知道是否有任何官方可用的来源吗?

Do you know if there is any official source available for this?

推荐答案

更新:截至 2020 年 5 月,Facebook 文档没有明确提到对 /sharer.php 网址的支持,而是由 分享按钮 页面仍然引用该路径.

Update: As of May 2020, the Facebook documentation doesn't explicitly mention support for /sharer.php URLs, but the snippets generated by Share Button page still refer to that path.

自从第一次被问到这个问题已经过去了一段时间,但 Facebook 文档中的一些新信息让我们有可能看到一些官方的证据",证明 sharer.php 共享链接的方法仍然有效, 仍然受到支持,并且还活着.

Some time has past since this first was asked but some new information from the Facebook documentation has given us the possibility to see some official "proof" that the sharer.php method of sharing links still works, is still supported and is alive and kicking.

参考是文档的这一页和还给出了几个例子:

The reference is this page of the documentation and a few examples are also given:

共享对话框最简单的用法如下:

This is what the simplest use of the share dialog looks like:

<a href="https://www.facebook.com/sharer/sharer.php?u=example.org" target="_blank">
  Share on Facebook
</a>

还有:

您可以在新窗口或弹出窗口中指向此 URL.如果你使用JavaScript 弹出打开一个新窗口,你也可以参考的 URL当前页面被共享为 location.href.这给了你代码您可以在所有页面上使用:

You can point to this URL in a new window or a popup. If you use JavaScript to pop open a new window, you can also refer to the URL of the current page being shared as location.href. That gives you code you can use on all pages:

var sharer = "https://www.facebook.com/sharer/sharer.php?u=";
window.open(sharer + location.href, 'sharer', 'width=626,height=436');

总而言之,确实有一段时间 sharer.php 的行为是不可预测的.人们普遍认为,该方法已被弃用,使用它是不明智的.这现已正式被破坏,因为 sharer.php 的示例用法已添加到 Facebook 的文档中.

To summarize, there was indeed a period of time when the behavior of the sharer.php was unpredictable. It was widely accepted that the method had been deprecated and that it was not wise to use it. This has now officially been busted as an example usage of sharer.php was added to Facebook's documentation.

这篇关于Facebook分享按钮:它正式死了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆