简体   繁体   中英

Facebook Plugin refuses to load on Website

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM