MarkP
MarkP

Reputation: 2566

Capture Google+ Button click event

Edit: See JSFiddle - http://jsfiddle.net/VW4ea/

I'm trying to capture the click event of the Google+ Button. However this is proving a little more difficult than expected.

Here is the function:

function myCallback(){
  console.log("callback");
}

After reading this post: Google Plus One Button - How to add a callback? I added:

data-callback="myCallback" 

to the g+ button but it still isn't working.

Can anyone help with this?

Upvotes: 0

Views: 564

Answers (2)

DannyBios
DannyBios

Reputation: 81

Try adding the function to be called script above the button.

Upvotes: 1

Zach Saucier
Zach Saucier

Reputation: 25944

The problem is that your jsFiddle isn't looking for javascript calls in the HTML.

Change onLoad to No wrap - in <body> in the drop down to the left and it works just fine

Demo

Upvotes: 3

Related Questions