【发布时间】:2012-03-22 18:41:39
【问题描述】:
我在同一个 wordpress 页面中有 3 个 google +1 按钮。但是其中一个在单击时失败(在然后浮动横向小部件中)显示exclamation mark。
再次点击会打开以下页面: +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>
欢迎提出任何建议。
【问题讨论】:
标签: javascript wordpress google-plus social