我正在使用中提供的相同代码here http://developers.facebook.com/docs/reference/javascript/
<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 连接”。我敢打赌你也有类似的问题。刚刚发生在我身上。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)