【发布时间】:2012-03-23 22:36:02
【问题描述】:
我正在使用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));
谁能帮我弄清楚这些行有什么问题?
【问题讨论】:
标签: javascript facebook rest get