2012-08-06 31 views
-1

我在jboss-web.deployer \ ROOT.war命名的test.html中創建了一個測試頁面。Facebook Like - 標題和說明不起作用

我已添加Facebook按鈕和OG元標記。當我點擊喜歡,標題和描述不在Facebook上共享。即使我無法看到彈出窗口,當我點擊按鈕。請幫助....

請看以下代碼:

<html xmlns="http://www.w3.org/1999/xhtml" 
     xmlns:og="http://ogp.me/ns#" 
     xmlns:fb="https://www.facebook.com/2008/fbml"> 
    <head> 
    <title>The Rock (1996)</title> 
    <meta property="og:title" content="The Rock"/> 
    <meta property="og:type" content="movie"/> 
    <meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/> 
    <meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/> 
    <meta property="og:site_name" content="IMDb"/> 
    <meta property="fb:admins" content="USER_ID"/> 
    <meta property="og:description" 
      content="A group of U.S. Marines, under command of 
        a renegade general, take over Alcatraz and 
        threaten San Francisco Bay with biological 
        weapons."/> 
    </head> 

<body> 
    <!-- AddThis Button BEGIN --> 
<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/all.js#xfbml=1"; 
    fjs.parentNode.insertBefore(js, fjs); 
}(document, 'script', 'facebook-jssdk'));</script> 


<fb:like href="href="http://157.241.56.242:8080/Test5.html" width="450" height="80"/> 

<!-- AddThis Button END --> 

</body> 
</html> 

回答

0

你並不需要添加一個XML命名空間,而是一個前綴來代替。下面是一個標記與從http://ogp.me/

<html prefix="og: http://ogp.me/ns#"> 
+0

感謝烏爾回覆,但仍然沒有工作..... – user1578382 2012-08-07 05:23:04

+0

我無法重現你的問題。使用一個簡單的html文件以及您發佈的代碼,Facebook向我展示了一幅圖片「The Rock(1996)」作爲標題和定義的描述。 – 2012-08-07 10:47:01

+0

你可以給我們一個測試用例,這已經不起作用了嗎? – 2012-08-07 10:47:25