我正在使用与
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个错误
它指出的错误是:
- ref.parentNode.insertBefore(js,ref);
- }(document));
谁能帮我弄清楚这些线路有什么问题?
解决方法
我在chrome中使用ghostery,没有注意到它被阻止’facebook connect’.我敢打赌你有一个类似的问题.刚刚发生在我身上