0
我正在工作車輛跟蹤網站,在這裏我必須分享一些動態內容在谷歌加分享,這是作爲預充文本。問題是我分享在谷歌加分享的內容,當我第一次點擊谷歌加分享,內容獲取後自動刷新一分鐘一次通過ajax,預充文本內容得到更新,但我點擊分享按鈕在谷歌加分享窗口內容不會發布給任何人。谷歌加分享使用動態內容不工作
下面是示例代碼
<html>
<head>
<title>Share Demo: Deferred execution with language code</title>
<link rel="canonical" href="http://www.example.com" />
</head>
<body>
<script type="text/javascript" src="https://apis.google.com/js/client:plusone.js"></script>
<div id ="sharePost" action="share">Share</div>
<script>
function add(){
var options = {
contenturl: 'https://plus.google.com/pages/',
contentdeeplinkid: '/pages',
clientid: 'xxx',
cookiepolicy: 'single_host_origin',
prefilltext: 'Hai happy friday'+Math.random(),
calltoactionlabel: 'CREATE',
calltoactionurl: 'http://plus.google.com/pages/create',
calltoactiondeeplinkid: '/pages/create'
};
// Call the render method when appropriate within your app to display
// the button.
gapi.interactivepost.render('sharePost', options);
}
setInterval(function(){
add();
},2000);
add();
</script>
</body>
</html>