Mobile app version of vmapp.org
Login or Join
Gloria169

: Embed Facebook Page Plugin I've been following facebook instructions in order to embed their "page plugin" in my website, and failing. (See instructions here.) Would you please take a look at

@Gloria169

Posted in: #Embed #Facebook #Javascript #Plugin

I've been following facebook instructions in order to embed their "page plugin" in my website, and failing. (See instructions here.)

Would you please take a look at my code and help me out? thanks in advance!

<body>

<!-- Include the JavaScript SDK -->

<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/es_LA/sdk.js#xfbml=1&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<!-- Include the plugin -->

<div class="fb-page" data-href="https://www.facebook.com/instagram"
data-width="280" data-hide-cover="false" data-show-facepile="false"
data-show-posts="true"></div>
</body>

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Gloria169

2 Comments

Sorted by latest first Latest Oldest Best

 

@Jamie184

Turns out the solution was quite simple:

I just added the script section INSIDE body tag, right AFTER the plugin and it started working.

Thanks!

10% popularity Vote Up Vote Down


 

@Vandalay111

Simple placement error, you have your javascript within the <body> tags whereas they should be outside of it.

Just move your first seven lines of code so that they are after your tags. See below;

<!-- Include the JavaScript SDK -->

<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/es_LA/sdk.js#xfbml=1&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<!-- Include the plugin -->

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme