【问题标题】:Resource Error embedding FB Like Button嵌入 FB Like 按钮的资源错误
【发布时间】:2013-12-06 10:13:22
【问题描述】:

我正在尝试使用来自 FB 开发者页面的 HTML 和 JS SDK 源代码在网页中嵌入点赞/分享按钮,但在 Web 控制台中出现以下错误:

加载资源失败:在此服务器上找不到请求的 URL。 file://connect.facebook.net/en_US/all.js#xfbml=1

任何意见表示赞赏。

夏兰

要求的代码:

 <!--LOAD FACEBOOK JSSDK FOR LIKE ETC-->
<div id="fb-root"></div>
  <script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "http://connect.facebook.net/en_US/all.js#xfbml=1&appId=113830492072210";
  fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));</script>

 <!--FACEBOOK LIKE-->
        <div class="fb-like" data-href="http://www.mooneycallans.com" data-send="false" data-layout="button_count" data-width="50" data-show-faces="false" data-colorscheme="dark" data-font="verdana"></div>

我使用的ID是从FB页面https://developers.facebook.com/docs/plugins/like-button/默认提供的。

也适用于 JS Fiddle: http://jsfiddle.net/

insertmg 前缀 http: 在 src URL 之前(现在为 http:file://connect.facebook.net/en_US/all.js#xfbml=1) 我仍然收到资源错误,并且:

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings.  It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains

令人困惑...

【问题讨论】:

  • 你能给我们看一些代码吗

标签: html facebook


【解决方案1】:

当 Facebook JS 试图引用网站时,我正在从本地主机进行测试。 通过将带有脚本的 HTML 文件保存到服务器并从那里运行它很好。

似乎是一个经常遇到的问题。

Ta 用于输入。

【讨论】:

    【解决方案2】:

    该错误意味着找不到喜欢/分享按钮。检查他们的链接是否有任何错误,并检查该按钮是否仍然存在于服务器上

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多