gpt4 book ai didi

javascript - e.root 在 all.js 中未定义

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:27:50 25 4
gpt4 key购买 nike

任何人都知道为什么我会收到以下错误:

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>

XXX X X X XX X XX X XXXXX X XXXX X XXX

XXX X X X XX X XX X XXXXX X XXXX X XXX

XXX X X X XX X XX X XXXXX X XXXX X XXX

XXX X X X XX X XX X XXXXX X XXXX X XXX

XXX X X X XX X XX X XXXXX X XXXX X XXX

最佳答案

我认为“<div id="fb-root"></div>”必须出现在脚本包含之前......

关于javascript - e.root 在 all.js 中未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8422029/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com