1
我正在嘗試在我的網站上使用Google+分享。我正在使用一個錨標籤。Google+分享未填充圖片,標題,說明
<a target="_blank" id="btnGoogleShare" href="#" runat="server">
Google+</a>
在後面的代碼我設置HREF作爲
btnGoogleShare.Href = "https://plus.google.com/share?url=[My site url]/page?_i=10"
我添加
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
</script>
<meta itemprop="name" content="Sample Title">
<meta itemprop="description" content="Sample Description">
<meta itemprop="image" content="[My site url]/SampleImage.jpg">
<meta property="og:type" content="website">
<meta property="og:url" content="https://plus.google.com/share?url=https://plus.google.com/share?url=http//:MySite.com/page?_i=10>
<meta property="og:title" content="Sample Title">
<meta property="og:description" content="Sample Description">
<meta property="og:image" content="[my site URL]/SampleImage.jpg">
我正在我的網站在本地主機在Visual Studio繼頭標記標籤。當我點擊鏈接時,我只能在谷歌加分享對話框中獲得網址。標題,說明,圖像沒有填充。任何想法?這可能是因爲我在使用本地主機的Visual Studio中的開發環境中運行?
謝謝亞伯拉罕,我沒有意識到這件事。所以這意味着如果我將更改部署到服務器,那麼它會自動選擇所有正確的信息,或者我需要做任何其他的事情。我寫的代碼可以嗎?如果需要更改,請提出建議。 – Deepak 2014-09-01 07:03:01
只要你按照[文檔](https://developers.google.com/+/web/snippet/)你應該沒問題。部署更新後,可以使用[結構化數據工具](https://www.google.com/webmasters/tools/richsnippets)對其進行測試。 – abraham 2014-09-01 08:50:06