[英]The page doesn't reload facebook plugin
Facebook script: Facebook脚本:
(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.3&appId=856804484356308";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
script: 脚本:
function loadHome(){
$( ".scorrimentoslide" ).fadeIn("slow");
//Ripristina il vecchio div dell'homepage in index.html
$('.sfondobianco').load(document.URL + ' .sfondobianco');
}
html: 的HTML:
<div class="sfondobianco">
<div class="menusinistra">
<div class="fb-page" data-href="https://www.facebook.com/pages/Big-GYM/1567454133517054?fref=ts" data-height="100%" data-hide-cover="false" data-show-facepile="true" data-show-posts="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/pages/Big-GYM/1567454133517054?fref=ts"><a href="https://www.facebook.com/pages/Big-GYM/1567454133517054?fref=ts">Big GYM</a></blockquote></div></div>
</div>
<div class="contenitoredestra">
<div class="banner"> <img src="images/save.png" style="max-width:100%;height:auto;"> </div>
<div class="container marketing contenitore">.........
I put (facebook script) at the bottom of the homepage. 我将(facebook脚本)放在首页的底部。 If i change div:contenitoredestra when i load another page, the facebook div doesnt disappear.
如果我在加载另一页时更改div:contenitoredestra,则div不会消失。 But when i go back at the home, the div disappear.
但是当我回到家中时,div消失了。 Why?
为什么? What can i do?
我能做什么? The site is http://hyp.altervista.org/index.html#
该网站为http://hyp.altervista.org/index.html#
You probably have to use FB.XFMBL.parse() right after adding plugins dynamically: 动态添加插件之后,您可能必须立即使用FB.XFMBL.parse() :
$('.sfondobianco').load(document.URL + ' .sfondobianco', function() {
FB.XFBML.parse();
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.