【问题标题】:google+ like button isn't working in django templategoogle+ like 按钮在 django 模板中不起作用
【发布时间】:2014-05-05 08:17:03
【问题描述】:

我在网页中使用了这段代码

<div class="g-plusone" size="small"></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>

但是当我点击 g+ 按钮时,什么都没有发生,我的意思是没有像我们为 facebook/twitter 做的那样的弹出窗口?我在这段代码中遗漏了什么吗?

【问题讨论】:

    标签: javascript html django django-templates google-plus


    【解决方案1】:

    不,它工作得很好,

    这里是Demo

    (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);
       })();
    

    使用 chrome 开发者工具调试错误。很有用。

    【讨论】:

      猜你喜欢
      • 2014-06-21
      • 2017-03-28
      • 1970-01-01
      • 2020-04-22
      • 1970-01-01
      • 2016-12-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多