gpt4 book ai didi

javascript - Facebook 点赞按钮空白页

转载 作者:行者123 更新时间:2023-12-03 08:05:02 25 4
gpt4 key购买 nike

我正在我自己的页面中测试 facebook like 按钮的集成,但似乎没有成功,这是我的代码:

<html>
<head>
<title>Your Website Title</title>
</head>
<body>

<script>
window.fbAsyncInit = function() {
FB.init({
appId : '613335972130771', // I changed this appId when I pasted the code
xfbml : true,
version : 'v2.5'
});
};

(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=613335972130771";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>

<div class="fb-like" data-href="https://www.facebook.com/" data-width="400" data-layout="button" data-action="like" data-show-faces="false" data-share="false"></div>

我在控制台中什么也没有得到,并且页面保持空白。

最佳答案

这是一个工作片段

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example Like</title>
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=692966564061436";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="container">
<div class="fb-like" data-href="http://example.com" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
</div>
</body>
</html>

关于javascript - Facebook 点赞按钮空白页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34419677/

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