Tag: 谷歌加

使用jquery获取google plus shares

我正在尝试使用Jquery获取Google加上共享的URL。 url = ‘www.abc.com/’; $.getJSON(‘https://clients6.google.com/rpc?key=AIzaSyBeAeOUk3BJs9ZXeohJX6Qt2zWXPQsRKRk’+’callback=?’, { “method”:”pos.plusones.get”, “id”:”p”, “params”:{ “nolog”:true, “id”:’http://prince-antil.myshopify.com/’, “source”:”widget”, “userId”:”@viewer”, “groupId”:”@self” }, “jsonrpc”:”2.0″, “key”:”p”, “apiVersion”:”v1″, }, function(data){ plusones = data.count; alert(data); }); 但我收到以下错误: { “error”: { “code”: 400, “message”: “Bad Request”, “data”: [ { “domain”: “usageLimits”, “reason”: “keyInvalid”, “message”: “Bad Request” } ] }, “id”: “p” } 我创建了一个API,但我不确定我创建它的方式。 以上错误表示“无效密钥”。 我已经交叉检查了密钥,但密钥是正确的。 我不知道在APP领域是否有特殊需要配置。 我是新的呃。 […]

谷歌登录回调 – 获取姓名和电子邮件

我试图在登录时将基本的Google帐户信息(名称,电子邮件,ID。)捕获到数据库中。 我这样做是通过为他们的个人资料信息设置变量并通过AJAX更新数据库。 (参见下面的例子中的变量) if (authResult[‘access_token’]) { // The user is signed in this.authResult = authResult; helper.connectServer(); // After we load the Google+ API, render the profile data from Google+. //this renders profile information to the page just fine gapi.client.load(‘plus’,’v1′,this.renderProfile); var email = gapi.client.load(‘plus’,’v1′,this.getEmail); var acct_type = ‘G’; var id = gapi.client.load(‘plus’,’v1′,this.getId); var fname = gapi.client.load(‘plus’,’v1′,this.getFname); […]

Google Plus One Button – 如何添加回调?

我在我的网站上呈现了谷歌+按钮,如下所示: 在JS中: 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); 在html中: 如何为此添加回调以检测用户何时单击? 我在这里看到了文档: https : //developers.google.com/+/plugins/+1button/#jsapi没有看到如何使用当前渲染实现。 谢谢

Google使用Javascript API登录而不触发弹出窗口

我使用以下代码让用户能够通过Javascript API使用他们的Google帐户登录。 HTML Login using Google 使用Javascript function gPOnLoad(){ // G+ api loaded document.getElementById(‘gp_login’).style.display = ‘block’; } function googleAuth() { gapi.auth.signIn({ callback: gPSignInCallback, clientid: googleKey, cookiepolicy: “single_host_origin”, requestvisibleactions: “http://schema.org/AddAction”, scope: “https://www.googleapis.com/auth/plus.login email” }) } function gPSignInCallback(e) { if (e[“status”][“signed_in”]) { gapi.client.load(“plus”, “v1”, function() { if (e[“access_token”]) { getProfile() } else if (e[“error”]) { console.log(“There was […]

在文本中间自动完成(例如Google Plus)

有很多选择可以做自动完成。 他们中的大多数似乎都在输入的前几个字母上工作。 在Google Plus中,自动填充选项在输入@后很快就会下降,无论它在表单字段中出现在何处,并使用@后面的字母来指导自动完成。 (它看起来也很不错!) 有没有人共享代码来做这种事情? 有没有人有任何指针试图实现这个玩具版本(例如在jQuery中)?