Reputation: 55
Hi guys i'm trying to use a Facebook Plugin from the Facebook website. It's a simple comment plugin. It seems everytime i try to get this thing to load it refuses too. My page has a very slow loading time from this plugin, so i know it's trying to load something. What am i doing wrong with the directions from the website?
I'm posting the script right after the body tag as directed.
<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/sdk.js#xfbml=1&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
and i'm placing the HTML inside of the Div i wish the plugin to load in. Which is also 300px in width.
<div class="fb-comments" data-href="http://developers.facebook.com/docs/plugins/comments/" data-width="300" data-numposts="3" data-colorscheme="light"></div>
But still this thing will not load.
Upvotes: 0
Views: 240
Reputation: 161
I apologize it didn't even need the jQuery script: verbatim what i pasted into an page called fb.htm
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<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/sdk.js#xfbml=1&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<p>FB tester</p>
<div class="fb-comments" data-href="http://developers.facebook.com/docs/plugins/comments/" data-numposts="5" data-colorscheme="light"></div>
</body>
</html>
Upvotes: 1