无法将命名锚点与 Facebook 选项卡链接一起使用

发布于 2025-01-02 01:39:29 字数 651 浏览 3 评论 0原文

我尝试在 Facebook 选项卡的一部分上放置一个命名锚点,并将“#anchor”添加到共享 URL,这样当用户单击共享链接时,它将直接将他们带到选项卡上的正确内容。

我添加到我的选项卡,然后重新编码 FB Feed 对话框 URL,因此

link=http://www.facebook.com/mybhg?sk=app_279723102083145#quiz

actions={name:'name',link:'http://www.facebook.com/mybhg?sk=app_279723102083145#quiz'}

测试对话框时显示错误,指出这两个链接都是无效链接:

  • 需要有效的重定向 URI
  • 操作应该是包含“名称”和“链接”的 JSON 编码字典 所以我对 Facebook 接受的密钥

进行了 bit.lyd,您可以共享短 URL。当用户单击共享链接时,会使用正确的 URL(带有“#quiz”),但浏览器不会捕捉到锚点位置。

由于 FB 在原始 URL 上失败,我怀疑他们没有设置解析 URL 中的 #named 锚点,但我想将其发布到社区,看看是否有人让它工作(或确认它没有) 。)

谢谢!

I'm attempting to put a named anchor on a part of our Facebook tab and add "#anchor" to the shared URL so when users click the shared link it will take them directly to the proper content on the tab.

I added to my tab and then recoded the FB Feed Dialog URL so

link=http://www.facebook.com/mybhg?sk=app_279723102083145#quiz

and

actions={name:'name',link:'http://www.facebook.com/mybhg?sk=app_279723102083145#quiz'}

In testing the dialog displayed an error saying both of these were invalid links:

  • Requires valid redirect URI
  • actions should be a JSON-encoded dictionary with "name" and "link" keys

So I bit.ly'd them which Facebook accepted and you can share the short URL. When users click the shared link though, the correct URL is used (with "#quiz") but the browser does not snap to the anchor location.

Since FB failed on the original URL, I suspect they aren't set up to parse #named anchors in their URLs, but I wanted to put it out to the community and see if someone has made it work (or confirmed it doesn't.)

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

他夏了夏天 2025-01-09 01:39:29

URL 片段(#)无法在服务器端读取。

您可以做的是使用 app_data 参数,该参数是在 signed_request 参数上转发给您的,相应地解析它,并使用一些 Javascript 来强制自己跳转。

URL fragments (the #) can't be read on the server side.

What you can do is use the app_data parameter, which is forwarded to you on the signed_request parameter, parse it accordingly, and have some Javascript to force the jump yourself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文