2015-03-02 26 views
0

我有下面的代碼,谷歌,加上自定義什麼是共享

<a href="https://plus.google.com/share?" onclick="javascript:window.open(this.href+'url={'+window.location.href+'}', 
    '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img src="google.png" alt="Share on Google Plus"></a> 

這完美的作品。我正在開發一個簡單的jquery和html遊戲,我想要做的是,一旦遊戲結束,讓玩家分享他們在google plus上的分數。以上將僅分享頁面。我會如何去做這件事?

回答

0

與Google+共享的內容由markup of the page being shared控制。

<body itemscope itemtype="http://schema.org/Thing"> 
    <h1 itemprop="name">Awesome Game 5000</h1> 
    <img itemprop="image" src="{image-url}" /> 
    <p itemprop="description">Super good score of {score}.</p> 
</body> 

爲了動態地改變人們共享的分數,您必須根據url動態更改分數。例如。 https://example.com/shared/5343將用5343替換頁面上的分數。