Javascript e、 root在all.js中未定义
有人知道我为什么会出现以下错误:Javascript e、 root在all.js中未定义,javascript,facebook,Javascript,Facebook,有人知道我为什么会出现以下错误: e.root is undefined in all.js 我真的不知道我这里出了什么问题。这是我代码的相关部分 <script src="https://connect.facebook.net/en_US/all.js"></script> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({ appId
e.root is undefined in all.js
我真的不知道我这里出了什么问题。这是我代码的相关部分
<script src="https://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxxxxxxxxxxxxxxxx', // App ID
channelURL : 'https://nowfoods.marketspacecom.com/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});
// Additional initialization code here
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
</head>
<body>
<a href="javascript:fb_publish();" class="fbshare"><img src="images/share.gif" /></a>
<script type="text/javascript">
//set the height of the canvas
window.fbAsyncInit = function() {
FB.Canvas.setSize({height: 1250});
}
//this function will publish a post to the user's wall
function fb_publish() {
// calling the API ...
var obj = {
method: 'feed',
name: 'Get a free sample of <?php echo $getLatestPromoID['prodName']; ?> from NOW Foods!',
link: '<?php echo $fbconfig['appBaseUrl']; ?>',
picture: 'https://nowfoods.marketspacecom.com/images/nowicon.gif',
caption: 'NOW Foods Free Samples',
description: 'I just signed up for a free sample of NOW Foods <?php echo $getLatestPromoID['prodName']; ?>. You can get one too at the link above!'
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
</script>
<div id="fb-root"></div>
</body>
window.fbAsyninit=函数(){
FB.init({
appId:'xxxxxxxxxxxxxxxx',//应用程序ID
频道URL:'https://nowfoods.marketspacecom.com/channel.html“,//通道文件
状态:true,//检查登录状态
cookie:true,//启用cookie以允许服务器访问会话
oauth:true,//启用oauth 2.0
xfbml:true//解析xfbml
});
//这里有额外的初始化代码
};
//异步加载SDK
(职能(d){
var js,id='facebook jssdk';if(d.getElementById(id)){return;}
js=d.createElement('script');js.id=id;js.async=true;
js.src=“//connect.facebook.net/en_US/all.js”;
d、 getElementsByTagName('head')[0].appendChild(js);
}(文件);
//设置画布的高度
window.fbAsyninit=函数(){
FB.Canvas.setSize({height:1250});
}
//此功能将发布帖子到用户的墙上
函数fb_publish(){
//正在调用API。。。
var obj={
方法:“提要”,
name:“从现在起免费获取食物样本!”,
链接:“”,
图片:'https://nowfoods.marketspacecom.com/images/nowicon.gif',
描述:“现在食品免费样品”,
描述:“我刚刚注册了一份免费的NOW食品样品。你也可以在上面的链接上获得一份!”
};
函数回调(响应){
document.getElementById('msg').innerHTML=“Post ID:”+response['Post_ID'];
}
FB.ui(obj,回调);
}
XXX X XX X XX X XXXXX XXXXX XXXXX XXX
XXX X XX X XX X XXXXX XXXXX XXXXX XXX
XXX X XX X XX X XXXXX XXXXX XXXXX XXX
XXX X XX X XX X XXXXX XXXXX XXXXX XXX
XXX X XX X XX X XXXXX XXXXX XXX在脚本包含之前必须有“
”,我认为