gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 19:46:24 25 4
gpt4 key购买 nike

我在同一个 WordPress 页面中有 3 个 google +1 按钮。但其中一个在单击时失败(在 float 横向小部件中),显示感叹号。

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 的 URL。

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

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

关于javascript - +1 按钮不可用或已停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9828494/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com