我有简单的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 popup中的分享按钮时出现错误:
保存帖子时出现问题。请再试一次。 我无法在谷歌+上分享。如何解决此错误?