+1按钮不可用或已停止工作

时间:2012-03-22 18:41:39

标签: javascript wordpress google-plus social

我在同一个wordpress页面中有3个google +1按钮。但是当点击(然后浮动横向窗口小部件)显示exclamation mark时,其中一个失败。

enter image description here

再次单击时,将打开以下页面: +1 button is unavailable or has stopped working.我很确定没有描述可能的原因。

两者的代码几乎相同:

// float code (malfunction)
<div id="float_plusone">
<g:plusone size="tall" href="<?php echo urlencode(get_permalink()); ?>" count="true"></g:plusone>
</div>
<script type="text/javascript">
(function() {
var po = document.createElement("script"); po.type = "text/javascript"; po.async = true;
po.src = "https://apis.google.com/js/plusone.js";
var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s);
})();
</script>

// above/below posts code (works)
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
<g:plusone size="medium" callback="googleplus_click"></g:plusone>

非常欢迎任何建议。

1 个答案:

答案 0 :(得分:2)

这是按钮发送到服务器的URL +1。

"id":"http://bestpushchairs.net/qc21/disclosure-policy/http%3A%2F%2Fbestpushchairs.net%2Fqc21%2Fdisclosure-policy%2F"

看起来按钮取href值并假设它相对于当前路径。请勿尝试使用urlencode

相关问题