【问题标题】:Social buttons dont show on local computer社交按钮不显示在本地计算机上
【发布时间】:2012-03-01 09:46:45
【问题描述】:

我最近一直在尝试添加 facebook like 按钮、twitter 按钮和 google plus 按钮。虽然我设法在我的网站上添加了 facebook like 按钮,但 twitter 按钮和 google+ 按钮似乎没有出现。

我应该提到我正在尝试将这些添加到本地计算机上,并且在使用 jsFiddle 检查时它们工作得很好,我怎样才能让它们在我的本地计算机上工作

这是我的推特按钮:

<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.facebook.com/pages/WillKode/228217780608588" data-text="willkode" data-via="willkodeforyou">Tweet</a>
<script>
    !function(d,s,id){
        var js,fjs=d.getElementsByTagName(s)[0];
        if(!d.getElementById(id)){
            js=d.createElement(s);
            js.id=id;js.src="//platform.twitter.com/widgets.js";
            fjs.parentNode.insertBefore(js,fjs);}}
            (document,"script","twitter-wjs");
</script>

对于 twitter 按钮,我只获得没有 twitter 设计的链接

这是我的 google+ 按钮:

<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="medium" annotation="inline"></g:plusone>

<!-- Place this render call where appropriate -->
<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>

google + 1 按钮根本没有显示,我也没有找到可以添加我想分享的链接的任何地方。在 jsFiddle 上,我在添加代码时得到了这个:});//]]>

【问题讨论】:

    标签: twitter google-plus-one


    【解决方案1】:

    在这个论坛上查看@sourcecraft 的推文...https://dev.twitter.com/discussions/304?page=1

    您似乎必须从主机运行您的网站...否则按钮将无法正常工作....

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多