Google互动式帖子按钮在单击时显示空白屏幕 [英] Google Interactive post Button shows blank white screen on Click

查看:71
本文介绍了Google互动式帖子按钮在单击时显示空白屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在添加此iframe[src^="https://apis.google.com"] { display: none; }以禁止Google+登录欢迎返回消息后,当我单击共享按钮时,我的Google+交互式帖子共享按钮停止显示,而只是显示了褪色的白屏,但​​是当我删除或更改了iframe display to visible,交互式发布按钮开始工作.

After I included this iframe[src^="https://apis.google.com"] { display: none; } to suppress Google+ Sign-in Welcome Back Message, my Google+ Interactive post share button stopped showing when I click on the share button rather it just shows a faded white screen but when I remove or change the iframe display to visible, the interactive post button starts working.

请问有人知道我可以做些什么来使交互式帖子开始工作,同时仍将iframe属性保留为display:none吗?

Please does anybody know what I can do to make the interactive post start working while still leaving the iframe attribute to display:none ?

推荐答案

此问题涵盖了一种抑制消息的方法,但看起来您已经在执行此操作.对于某些人来说,使用iframe正则表达式来抑制欢迎消息有效-但是,这可能是导致呈现交互式帖子时出现问题的原因,而没有它,您应该能够解决.您的页面仍然可能存在其他原因,因此您可能希望从一个简单的版本开始并从那里进行调试.

This question covers one way to suppress the message but it looks like you are doing this already. For some folks, using the iframe regex to suppress the welcome message works - however, could be what is causing the issue when rendering the interactive post and you should be able to get by without it. There still could be other causes specific to your page so you might want to start with a simple version and debug from there.

以下代码对我有用-请注意,我根本没有使用正则表达式,但是消息仍然被隐藏:

The following code is working for me - note that I am not using the regex at all but the message still gets hidden:

<html>
  <body>
    <script src="https://apis.google.com/js/plusone.js">
      isSignedOut: true
    </script>
    <button
      class="g-interactivepost"
      data-contenturl="https://plus.google.com/pages/"
      data-contentdeeplinkid="/pages"
      data-clientid="268858962829.apps.googleusercontent.com"
      data-cookiepolicy="single_host_origin"
      data-prefilltext="Engage your users today, create a Google+ page for your business."
      data-calltoactionlabel="CREATE"
      data-calltoactionurl="http://plus.google.com/pages/create"
      data-calltoactiondeeplinkid="/pages/create">
      Tell your friends
    </button>
  </body>
</html>

您可以在此处查看实际的演示.再次提醒您,我没有将iframe可见性设置为无,而在Chrome浏览器中它对我有效.

You can see the demo in action here. Again, note that I am not setting the iframe visibility to none and it is working for me in Chrome.

最后一点,您可能不想隐藏消息,因为它是一种很好的反馈机制,可让用户知道他们正在登录到您的网站.该消息仅在用户第一次通过浏览会话访问您的网站时出现.

A final note, you might not want to hide the message because it's a great feedback mechanism for letting the user know that they are being signed-in to your site. The message only appears the first time a user reaches your site in a browsing session.

这篇关于Google互动式帖子按钮在单击时显示空白屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆