【问题标题】:G+ share not workingG+ 分享不起作用
【发布时间】:2013-05-30 06:45:35
【问题描述】:

我有这个代码,

<g:plus action="share" href="{{url}}" style="height: 28px;" ></g:plus>

<script type="text/javascript">
      window.___gcfg = {
        lang: 'en-US'
      };

      (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+ 上分享 url,但我却获得了

当前网址/url

为什么?

【问题讨论】:

  • 您是否提供完整的绝对 URL,包括开头的 http/https 协议?否则 URL 将被视为相对 URL。
  • 谢谢!刚刚将 http:// 添加到 url ,它就像一个魅力知道

标签: google-api google-plus


【解决方案1】:

我发送的 url 没有 http://...(相对 url),这就是谷歌 api 将当前 url 添加到我的 url 的原因。

所以解决方案是发送一个绝对网址而不是相对网址。

【讨论】:

    猜你喜欢
    • 2019-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多