2011-09-06 40 views
1

我試圖將Facebook的開放圖整合到我的網站,但我通過URL Linter運行它,我得到的錯誤:「必需的屬性丟失,og:titleand og:url是必需的」。這是我的產品的說明頁面。facebook的問題與打開圖

我錯過了什麼嗎?

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#" > 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta name="Description" content="" /> 
<meta name="keywords" content="hard drives, electronics, cctv, cables, psu" /> 
<meta name="document-classification" content="" /> 

<meta property="og:title" content="CAT5e UTP PATCH ETHERNET NETWORK CABLE LEAD 0.5M GREEN" /> 
<meta property="og:type" content="product"/> 
<meta property="og:url" content="http://apps.facebook.com/maplinuk/buynow-id-10015,20015-cat5e-utp-patch-ethernet-network-cable-lead-0-5m-green.html" /> 
<meta property="og:image" content="http://www.247topseller.co.uk/clientstores/maplinuk/prod_image/rj45_250300.jpg" /> 
<meta property="og:site_name" content="maplinuk" /> 
<meta property="fb:app_id" content="{clipped}"/> 
<meta property="og:description" content="CAT5e UTP PATCH ETHERNET NETWORK CABLE LEAD 0.5M GREEN" /> 

</head> 
<body> 
<div id="fb-root"></div> 
<script type="text/javascript"> 

window.fbAsyncInit = function() { 
FB.init({appId: '{clipped}', status: true, cookie: true, xfbml: true}); 

    }; 
(function() { 
    var e = document.createElement('script'); e.async = true; 
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; 
    document.getElementById('fb-root').appendChild(e); 
}()); 
</script> 
<fb:like href="http://apps.facebook.com/maplinuk/buynow-id-10015,20015-cat5e-utp-patch-ethernet-network-cable-lead-0-5m-green.html" show_faces="true" width="450" font=""> </fb:like> 
</body> 
</html> 
+0

是你的代碼中暴露的實際appId?你應該有一個國防部刪除它,所以它不能被看到,即使在編輯屏幕。 – Sparky

+0

謝謝你Sparky672 .. – vicky

回答

1

我相信問題的產生是因爲你的og:url指向一個應用程序頁面(你的,我假設)。

據我所知,Like按鈕的Facebook代碼將轉到該URL並嘗試從那裏檢索元數據 - 而不是從您在此處發佈的原始頁面。

因此,錯誤消息告訴你,你的Facebook內的應用程序頁面沒有這些元數據元素。

我已經更詳細地解釋了the use of og:url

大衛