包括facebook事件页面抛出错误

Including facebook event on page throws errors

本文关键字:出错 错误 facebook 事件 包括      更新时间:2023-09-26

我想在我的网站上嵌入一个facebook事件。我从facebook获得了"嵌入事件"按钮的代码,但它不断抛出错误:Invalid App Id: Must be a number or numeric string representing the application id., FB.getLoginStatus() called before calling FB.init().This Facebook post is no longer available. It may have been removed or the privacy settings of the post may have changed.

这是代码:

<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/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-post" data-href="#" data-width="466">
    <div class="fb-xfbml-parse-ignore">
        <a href="#">Post</a>
        by 
        <a href="#">User</a>.
    </div>
</div>

注意:为了我的隐私,我把所有的href都换成了"#":p

如果你的网站是基于Wordpress安装的,请仔细检查你的帖子页面源代码。如果<script>标记被剥离,可能是由用户的权限引起的。尝试嵌入一个facebook帖子作为Wordpress管理员,它将工作。

相关文章: