Google Plus 按钮 API 是否支持 Internet Explorer 8

发布于 2024-12-27 16:07:52 字数 453 浏览 1 评论 0原文

有谁知道 IE8 是否支持 Google Plus 按钮?此问题表明它不支持 IE7:Google +1 按钮无法在 IE7 中工作?。此外,该问题还链接到一个页面 (http:// /support.google.com/accounts/bin/answer.py?hl=en&answer=1151309)表明支持 IE8。有趣的是,当我在 Chrome 中访问该页面时,我得到了 G+ 按钮,但当我在 IE8 中访问它时,却没有。

有什么想法吗?

Does anyone know if the Google Plus Button is supported in IE8? This question suggests that it does not support IE7: Google +1 Button not working in IE7?. Additionally, the question links to a page (http://support.google.com/accounts/bin/answer.py?hl=en&answer=1151309) that suggests that IE8 is supported. Interestingly, when I visit that page in Chrome, I get the G+ button, but when I visit it in IE8, I do not.

Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

晨光如昨 2025-01-03 16:07:52

有一个奇怪的 IE8 版本(仅限版本 8.0.7600.16385)很难获得,它会导致 Plus1 按钮渲染出现渲染错误。以下是解决此问题所需的代码:

    var gPlusOne = document.createElement('g:plusone'); 
    gPlusOne.setAttribute("size", "medium");
    gPlusOne.setAttribute("annotation", "bubble");
    gPlusOne.setAttribute("width", "120");
    googlePluginDiv[0].appendChild(gPlusOne);

请注意,我没有使用 jQuery,因为 jQuery 不喜欢名为 g:plugone 的元素,但它可以使用 document 呈现.createElement

There's one odd-ball version of IE8 (version 8.0.7600.16385 only) that is hard to come by and it causes a rendering error with the Plus1 button rendering. Here's the code you will need to use to get around this issue:

    var gPlusOne = document.createElement('g:plusone'); 
    gPlusOne.setAttribute("size", "medium");
    gPlusOne.setAttribute("annotation", "bubble");
    gPlusOne.setAttribute("width", "120");
    googlePluginDiv[0].appendChild(gPlusOne);

Notice I am not using jQuery as jQuery doesn't like the element named g:plugone, but it can be rendered with document.createElement

素手挽清风 2025-01-03 16:07:52

对我来说,你的解决方案不起作用(在指定版本的 ie8 上......)
然而,它使用 HTML5 语法工作。
我在这里找到它http://chovy.dyndns.org/social2.html

我重现了下面的解决方案,以防有一天托管失败:

<div class="g-plusone" data-size="standard" data-count="true" [or data-whatever=...]></div>

我没有尝试使用 JS 动态加载它,但我想应该没问题。

For me your solution didn't work (on the specified version of ie8...)
However, it worked using the HTML5 syntax.
I found it here http://chovy.dyndns.org/social2.html.

I reproduce the solution below in case the hosting get down one day :

<div class="g-plusone" data-size="standard" data-count="true" [or data-whatever=...]></div>

I didn't try to load it dynamically using JS, but I guess it should be OK.

﹉夏雨初晴づ 2025-01-03 16:07:52

在 IE8 和 IE9 中完美运行...但在 IE7 中不行

分享演示:JQuery Iframe

  </head>
  <body>
  <div id="gplusID"></div>

    <script type="text/javascript">
    var gdiv = document.getElementById('gplusID');
    var gPlusOne = document.createElement('g:plusone'); 
    gPlusOne.setAttribute("size", "medium");
    gPlusOne.setAttribute("annotation", "bubble");
    gPlusOne.setAttribute("width", "120");
    gdiv.appendChild(gPlusOne);
      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>  

  </body>

</html>

Works perfectly in IE8 and IE9...but not in IE7

Share Demo: JQuery Iframe

  </head>
  <body>
  <div id="gplusID"></div>

    <script type="text/javascript">
    var gdiv = document.getElementById('gplusID');
    var gPlusOne = document.createElement('g:plusone'); 
    gPlusOne.setAttribute("size", "medium");
    gPlusOne.setAttribute("annotation", "bubble");
    gPlusOne.setAttribute("width", "120");
    gdiv.appendChild(gPlusOne);
      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>  

  </body>

</html>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文