javascript 频道网址 Facebook

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15821196/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 02:13:07  来源:igfitidea点击:

Channel URL Facebook

javascriptfacebookfacebook-loginchannel

提问by Federico Capello

I'm implementing the facebook login in my website wich is in the form of mysite.anotherdomain.org . I did all explained in the Documentation of the Javascript SDK but, since I have some problems, I'm wondering if the error comes from the channel url.

我正在以 mysite.anotherdomain.org 的形式在我的网站上实现 facebook 登录。我在 Javascript SDK 的文档中做了所有解释,但是,由于我遇到了一些问题,我想知道错误是否来自频道 url。

What should I exactly write for the channel file?

我应该为频道文件写什么?

Thanks in advance!

提前致谢!

回答by asifrc

The channel file basically fixes certain cross-domain issues for certain browsers. The following are the three that Facebook has identified:

频道文件基本上修复了某些浏览器的某些跨域问题。以下是 Facebook 确定的三个:

  • Pages that include code to communicate across frames may cause Social Plugins to show up as blank without a channelUrl.
  • 包含跨帧通信代码的页面可能会导致社交插件在没有 channelUrl 的情况下显示为空白。
  • if no channelUrl is provided and a page includes auto-playing audio or video, the user may hear two streams of audio because the page has been loaded a second time in the background for cross domain communication.
  • 如果没有提供 channelUrl 并且页面包含自动播放的音频或视频,则用户可能会听到两个音频流,因为页面已在后台第二次加载以进行跨域通信。
  • a channel file will prevent inclusion of extra hits in your server-side logs. If you do not specify a channelUrl, you should remove page views containing fb_xd_bust or fb_xd_fragment parameters from your logs to ensure proper counts.
  • 频道文件将防止在您的服务器端日志中包含额外的点击。如果未指定 channelUrl,则应从日志中删除包含 fb_xd_bust 或 fb_xd_fragment 参数的页面浏览量以确保正确计数。
  • All you need inside the file is

    您只需要在文件中

    <script src="//connect.facebook.net/en_US/all.js"></script>
    

    You can find out more from https://developers.facebook.com/docs/reference/javascript/#channel

    您可以从https://developers.facebook.com/docs/reference/javascript/#channel了解更多信息