2011-03-23 118 views
0
</html> 
<head> 
</head> 
<body> 
<iframe src="http://www.facebook.com/plugins/like.php?href=http://rgksugan.in/" 
     scrolling="no" frameborder="0" 
     style="border:none; width:450px; height:80px"><iframe> 
<div id="fb-root"></div> 
     <script src="http://connect.facebook.net/en_US/all.js"></script> 
     <script> 
     FB.init({ 
      appId:'194541653919499', cookie:true, 
      status:true, xfbml:true 
     }); 
     </script> 
<fb:login-button>Login with Facebook</fb:login-button> 
</body> 
<html> 

这是我的HTML页面。我期待在我的页面中使用Facebook登录按钮。但它不出现。问题是什么?登录facebook时出现问题

+0

坏的HTML标签.. – Kon 2011-03-23 02:59:38

回答

1

嗨,你是否嵌入Facebook连接代码在你的HTML标记?其他的事情你必须同步或异步加载你的jsdk。之后放置像按钮的代码。首先让你的HTML标签类似这样的 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en"> ,然后只是你< body>标签

 
<body> 
window.fbAsyncInit = function() { 
    FB.init({ 
      appId:'194541653919499', cookie:true, 
      status:true, xfbml:true 
     }); 
}; 
    (function() { 
    var e = document.createElement("script"); 
    e.type = "text/javascript"; 
    e.src = document.location.protocol + 
    "//connect.facebook.net/en_US/all.js"; 
    e.async = true; 
    document.getElementById("fb-root").appendChild(e); 
    }()); 

</script> 

使用此代码对你的喜欢按钮后,试试这个。你的第三个问题是你的代码中有两个Facebook连接语句。当您使用异步方式与Facebook进行连接时,如果您使用按钮代码,则不需要重新连接。使用此代码

 
<fb:like href="http://rgksugan.in/" show_faces="true" width="450" font=""></fb:like> 
1

iframe按钮的结束标记格式不正确。

变化 <iframe src="http://www.facebook.com/plugins/like.php?href=http://rgksugan.in/" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"><iframe>

<iframe src="http://www.facebook.com/plugins/like.php?href=http://rgksugan.in/" 
    scrolling="no" frameborder="0" 
    style="border:none; width:450px; height:80px"></iframe>