Facebook新的Like Box(页面插件)不工作 [英] Facebook new Like Box (Page plugin) not working

查看:137
本文介绍了Facebook新的Like Box(页面插件)不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我正在尝试添加一个Facebook插件到我的页面,但它不会出现。我尝试不同的页面,但它不适用于没有人。一个例子是上述



我打开这些代码就在开始< body> 标签之后: p>

 < 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/el_GR/sdk.js#xfbml=1&version= v2.5& appId = 1712213445680154; fjs.parentNode.insertBefore(js,fjs);}(document,'script','facebook-jssdk'));< / script>`

然后我将我的插件的代码放在我想要的页面上,但是我看不到什么?发生了什么?



< div class =fb-pagedata-href =https://www.facebook.com/sportdog data-height =340data-small-header =falsedata-adapt-container-width =truedata-hide-cover =falsedata-show-facepile =true posts =true>< div class =fb-xfbml-parse-ignore>< blockquote cite =https://www.facebook.com/sportdog>< a href =https ://www.facebook.com/sportdog> SportDog.gr< / a>< / blockquote>< / div>< / div>

解决方案

我的回答迟到了,但值得的,在研究了很多个小时后,我遇到了同样的问题。给它尝试,它适用于你。您可以自定义 iframe ie width,show_facepile,small_header等的选项

可以在那里找到所有可定制选项的列表。

 <!DOCTYPE html> 
< html>
< head>
< title>页面标题< / title>
< / head>
< body>
< script>
window.fbAsyncInit = function(){
FB.init({
appId:'1614814185438138',
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;
fjs.parentNode.insertBefore(js,fjs);
}(document,'script','facebook-jssdk'));
< / script>
< iframe name =f11d8956d8height =1000pxframeborder =0allowtransparency =trueallowfullscreen =truescrolling =no
title =fb:page Facebook Social Plugin msgstr 2Fconnect%2Fxd_arbiter.php%3Fversion%3D42%23CB%3Df43cf5f68%26domain%3Dwww.facebook.com%26origin%3Dhttp%253A%252F%252Fwww.facebook.com%252Ff245f287b8%26relation%3Dparent.parent&放大器;放大器; container_width = 200安培;安培; hide_cover =假放大器;放大器; HREF = HTTPS%3A%2F%2Fwww.facebook.com%2FAndresIniesta&放大器;放大器;语言环境= EN_GB&放大器;放大器; SDK =乔伊&放大器;放大器; show_facepile =真放大器;放大器; small_header =真放大器;放大器; tabs = timeline
class =style =border:none; visibility:visible;>
< / iframe>
< / body>
< / html>


Hello I am trying to add a facebook plugin to my page but it doesn't appear. I try it for different pages but it doesn't working for no one. One example is the above

I put these code just right after the opening <body> tag:

<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/el_GR/sdk.js#xfbml=1&version=v2.5&appId=1712213445680154"; fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script>`

And then I place the code for my plugin wherever want it to appear on my page but I see just nothing? What's happening?

<div class="fb-page" data-href="https://www.facebook.com/sportdog" data- height="340" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-show-posts="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/sportdog"><a href="https://www.facebook.com/sportdog">SportDog.gr</a></blockquote></div></div>

解决方案

My answer is late, but its worthful, I faced same issue after researching it many hours I made it work in following way. Give it try and It works for you. You can customize options of iframe i.e width, show_facepile, small_header etc
List of all customisable options can be found there.

<!DOCTYPE html>
<html>
  <head>
    <title>Page Title</title>
  </head>
  <body>
    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : '1614814185438138',
          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";
         fjs.parentNode.insertBefore(js, fjs);
       }(document, 'script', 'facebook-jssdk'));
    </script>
    <iframe name="f11d8956d8" height="1000px" frameborder="0" allowtransparency="true" allowfullscreen="true" scrolling="no"
    title="fb:page Facebook Social Plugin" src="http://www.facebook.com/v2.5/plugins/page.php?adapt_container_width=true&amp;app_id=1614814185438138&amp;channel=http%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D42%23cb%3Df43cf5f68%26domain%3Dwww.facebook.com%26origin%3Dhttp%253A%252F%252Fwww.facebook.com%252Ff245f287b8%26relation%3Dparent.parent&amp;container_width=200&amp;hide_cover=false&amp;href=https%3A%2F%2Fwww.facebook.com%2FAndresIniesta&amp;locale=en_GB&amp;sdk=joey&amp;show_facepile=true&amp;small_header=true&amp;tabs=timeline"
    class="" style="border: none; visibility: visible;">
    </iframe>
  </body>
</html>

这篇关于Facebook新的Like Box(页面插件)不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆