Facebook新的Like Box(页面插件)不工作 [英] Facebook new Like Box (Page plugin) not working
问题描述
我打开这些代码就在开始< 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&app_id=1614814185438138&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&container_width=200&hide_cover=false&href=https%3A%2F%2Fwww.facebook.com%2FAndresIniesta&locale=en_GB&sdk=joey&show_facepile=true&small_header=true&tabs=timeline"
class="" style="border: none; visibility: visible;">
</iframe>
</body>
</html>
这篇关于Facebook新的Like Box(页面插件)不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!