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>