我有简单的 erb 模板,其中包含以下 html 代码和 javascript。
<a class='share_on_gplus g-plus' data-social-action='share' data-medium='googleplus' data-content='q_name' href='https://plus.google.com/share?url=encodeURIComponent(URL).replace('%20','+') onclick="javascript:window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=auto,width=600');return false';">Share with Google+ </a>
<script src="https://apis.google.com/js/client.js"></script>
<script type="text/javascript">
function load() {
gapi.client.setApiKey('XXXXXXXXXXXXXXXXXXx');
}
window.___gcfg = {
lang: 'en-US',
parsetags: 'onload'
};
(function() {
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
po.src = 'https://apis.google.com/js/plusone.js?onload=load';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
我的 Google +API 服务已经开启。当我在 google plus 弹出窗口中单击共享按钮时,出现错误:
保存您的帖子时出现问题。请再试一次。我无法在 google+ 上分享。如何解决此错误?