Google +徽章没有显示

Google plus badge not showing

本文关键字:显示 徽章 Google      更新时间:2023-09-26

我在Google +开发者上创建了一个徽章:https://developers.google.com/+/web/badge/但是当我复制和过去的代码到我的HTML文件徽章不显示。下面是我的代码:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Google + Badge</title>
  </head>
  <body>
    <!-- Place this tag where you want the widget to render. -->
    <div class="g-page" data-href="https://plus.google.com/109600806421917664383" data-rel="publisher"></div>
    <!-- Place this tag after the last widget tag. -->
    <script type="text/javascript">
      (function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/platform.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      })();
    </script>

  </body>
</html>

我做错了什么?由于

adeneo的JSFiddle也不适合我(Chrome 35, OSX)。首先,我必须在断开连接扩展中将其列入白名单。然后我得到控制台错误

Uncaught ReferenceError iframes is not defined

,根据http://www.jesse-smith.net/fixed-google-plus-1-button-working/和Google PlusOne按钮在Chrome上有错误,是由第三方cookie被阻止造成的。

如果你也在使用Chrome浏览器(并且这个问题也是由阻止第三方cookie造成的),应该在你的URL栏右侧有一个cookie图标。点击它,点击"显示cookie和其他站点数据…",切换到"阻止"选项卡,允许所有来自*.google.com域名的第三方cookie。

你也可以点击设置>显示高级设置>隐私,点击"内容设置"按钮,在任何地方启用第三方cookie。

不幸的是,我没能找到一种方法让你的G+按钮在禁用第三方cookie的浏览器中工作