Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery facebook页面插件仅显示带有页面名称的文本_Jquery_Html_Facebook_Plugins_Jquery Plugins - Fatal编程技术网

Jquery facebook页面插件仅显示带有页面名称的文本

Jquery facebook页面插件仅显示带有页面名称的文本,jquery,html,facebook,plugins,jquery-plugins,Jquery,Html,Facebook,Plugins,Jquery Plugins,我正在尝试在我的网页上添加Facebook页面插件。不幸的是,除了“facebook”这条文字外,什么也没有显示。我添加了他们给我的代码,完全符合要求。下面是我添加到空白.HTML页面的代码示例: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://

我正在尝试在我的网页上添加Facebook页面插件。不幸的是,除了“facebook”这条文字外,什么也没有显示。我添加了他们给我的代码,完全符合要求。下面是我添加到空白.HTML页面的代码示例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>Untitled Document</title>
</head>

<body>

<!-----------THIS IS THE FIRST STEP(just pasted the code FB gave me)------------>
<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.4";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


<!-----------THIS IS THE SECOND STEP(just pasted the code FB gave me)------------>
<div class="fb-page" data-href="https://www.facebook.com/facebook" data-tabs="timeline" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/facebook"><a href="https://www.facebook.com/facebook">Facebook</a></blockquote></div></div>


</body>
</html>

无标题文件
(功能(d、s、id){
var js,fjs=d.getElementsByTagName[0];
if(d.getElementById(id))返回;
js=d.createElement;js.id=id;
js.src=“//connect.facebook.net/en_US/sdk.js#xfml=1&version=v2.4”;
fjs.parentNode.insertBefore(js,fjs);
}(文档“脚本”、“facebook jssdk”);

添加的代码没有问题。。我还有什么需要补充或做的吗?此小部件链接到facebook的facebook页面。当我将它链接到我的页面时,它也会做同样的事情(只显示文本“corecoders”)。所有页面插件都只显示文本。

在本地网站上使用Xampp或Mamp修复了该问题。当托管时,它工作得很好。

您是否通过本地Web服务器测试您的页面,以便在浏览器中通过HTTP调用它?否则,SDK的协议相对URL,
js.src=“//connect.facebook.net/…
将无法工作。(除非您在其前面明确加上
http: