Google Plus共享和使用Google Plus登录消失了
Google Plus share and Sign in with Google plus disappeared
我已经在我的网站上登录了googleplus。它运行良好,并按照官方教程执行(https://developers.google.com/+/web/signin/)作为
class="g-signin"
data-callback="onSignInCallback"
data-clientid=<my id>
data-approvalprompt="force"
data-width="wide"
data-cookiepolicy="http://<?php echo $c_site; ?>.com"
data-requestvisibleactions="http://schemas.google.com/AddActivity"
data-scope="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email">
</span>
在官方网站上以各自的js客户端为例进行了编码几周前它消失了。与此同时,我在google+按钮上的分享也消失了。这也是有效的,并根据官方网站进行编码https://developers.google.com/+/web/share/
<div class="g-plus" data-action="share" data-annotation="none" displayText="<?php echo $someBullshit;?>" data-href="<?php echo $url;?>" ></div>
我不会在这里详细介绍,因为我的代码是逐字逐句地从教程中复制的。有人看到明显的东西了吗?g+api是否发生了严重变化?教程似乎没有改变
您的plusone.js include可能出了什么问题?确保这是在你的页面上,就在你的关闭体标签:之前
<!-- Place this asynchronous JavaScript just before your </body> 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/client:plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
要测试它是否已加载,请打开JavaScript控制台并测试是否存在gap对象:
gapi.plus.render
其次,看起来您的容器(跨度)没有打开标签。它应该读作:
<span class="g-signin"
data-callback="onSignInCallback"
data-clientid=<my id>
data-approvalprompt="force"
data-width="wide"
data-cookiepolicy="single_host_origin"
data-requestvisibleactions="http://schemas.google.com/AddActivity"
data-scope="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email">
最后,注意你设置cookiepolicy的方式。如果配置不正确,脚本将被阻止加载。尝试将其更改为single_host_origin,看看是否设置不正确(通常应该是http://yoursite.com或https://yoursite.comhttps和http会有所不同)。
相关文章:
- 嵌入Google Plus社区
- Google Plus一键后台错误-32099
- 在 Google Plus Button 上跟踪 click() 事件
- Google Plus图标未显示-“X-Frame-Options禁止显示”
- Google Plus通过javascript共享,带有自定义图像
- Google Plus登录-未知RPC服务错误
- 如何使用javascript在Google plus上分享
- Google Plus 在本地主机上登录 Cookie 政策
- Durandal JS and Google Plus Sign in Javascript API
- Google Plus api 调用未经身份验证
- 为什么Google Plus使用XHR加载CSS并将其附加到<样式>而不是使用
- 正确对齐Google Plus One和Facebook Like按钮
- 如何从我的公开个人资料上的 Google Plus API 帖子中获取社区标签
- 我如何在Google plus中阅读我的圈子/流
- 如何嵌入Google Plus撰写评论
- 重新分析Google Plus按钮
- 未捕获错误:Google Plus响应
- 无法停止使用google plus登录
- Google Plus API-密钥无效
- 使用passport.js的Google plus用户年龄范围