English 中文(简体)
How can I get the state ("on" or "off") of the Google +1 button?
原标题:

The +1 API documentation is here: http://code.google.com/apis/+1button/#jsapi

There is no mention of how to determine whether the viewing user has already clicked the button or not. This would be a very useful function because it would allow me to encourage people who haven t +1 d a page to do so without putting users who have already +1 d the page through a needless and possibly confusing step.

Has anyone found a way to do this? Thanks

问题回答

There is callback attribute, which allows you to add custom callback function, which can react to +1 or -1. See http://www.odditysoftware.com/blog/trap-and-track-google-plus-button-click-events_45.html

But your question is old, maybe it wasn t present yet.





相关问题
Google +1 button causes JavaScript error

We ve recently started using the Google +1 button on our page, but whenever we include the Google script block this JavaScript error comes up in IE8: "No relay set (used as window.postMessage ...

Google +1 Count for my homepage not for all subpages?

I implemented the fairly new Google +1 Button to a site I ve developed. It sits in my footer and I want people to just +1 this page if the think it s a cool page. Since I implemented it already a few ...

hide plusone button after click

I want to hide google s +1 button after the user clicks on it using jQuery; this is the code I m using but it seems it s not functioning properly: JS: $(function() { $("#button").click(function() ...

Google +1 Button not working in IE7?

Works fine in IE8, IE9, and latest Chrome and Firefox, but can t seem to get it to show up in IE7. This is even with the most basic example of using the script. Anyone had similar issues? Thanks!

Google +1 Button not W3C compliant

So I ve been playing with Google s +1 button trying to get it on my website, but it s not W3C compliant. Here s the code: <!-- Place this tag in your head or just before your close body tag -->...

Issue Loading Google +1 Widget Asynchronously

I have a few widgets on the site I m developing and I load them all asynchronously from a javascript file so it does not hold up the DOM from finishing. For instance, I do this with the Digg and Buzz ...

热门标签