I'm going to forbid a second click on Google +1 button.
<g:plusone callback='click_callback' href="myurl.com"></g:plusone>
My click_callback function is:
function click_callback(b) {
if(b.state == "on") {
$.ajax({
type: "POST",
url: "gp1process.php",
data: "id=" + id,
cache: false,
success: function(a) {
$("#Hint").html(a);
remove(id);
click_refresh()
}
})
}
Can I use one() method of jQuery?
Since I am not actually posting to an ajax request I placed the
$(this).attr("disabled", "disabled")before the ajax call but you will want it in your success function.What this will do is add the disabled="disabled" attribute to your button after you click it. I think that is what you were looking for.