Facebook SDK不加载... all.js GET失败 [英] Facebook SDK doesn't load...all.js GET failing

查看:117
本文介绍了Facebook SDK不加载... all.js GET失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的此处中提供的代码相同。

I'm using the same code provided in the here

<div id="fb-root"></div>
<script>
    window.fbAsyncInit = function() {
    console.log('got here');
    FB.init({
    appId      : '197112467099018', // App ID
    channelUrl : '//WWW.MYDOMAIN.COM/channel.html', // Channel File
    status     : true, // check login status
    cookie     : true, // enable cookies to allow the server to access the session
    xfbml      : true  // parse XFBML
   });

   // Additional initialization code here

   };

   // Load the SDK Asynchronously
   (function(d){
    var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
    if (d.getElementById(id)) {return;}
    js = d.createElement('script'); js.id = id; js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    ref.parentNode.insertBefore(js, ref);
   }(document));
 </script>

Chrome的控制台告诉我脚本无法加载(GET失败),带有2个错误,匿名函数)

Chrome's console is telling me the script failed to load (GET failed) with 2 errors which are labeled (anonymous function)

它指出的错误是:

   ref.parentNode.insertBefore(js, ref);
   }(document));

任何人都可以帮我弄清楚这些行出了什么问题?

Can anyone help me figure out whats wrong with these lines?

推荐答案

我在chrome中使用ghostery,没有注意到它被阻止了Facebook连接。我敢打赌你有一个类似的问题。刚刚发生在我身上。

I was using ghostery in chrome and didn't notice it blocked 'facebook connect'. I bet you have a similiar problem. Just happened to me.

这篇关于Facebook SDK不加载... all.js GET失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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