N
N
newaitix2018-09-10 10:36:06
Google
newaitix, 2018-09-10 10:36:06

Google share button callback?

<a target="_blank" id="mybutton" data-callback="myCallback" href="https://plus.google.com/share?url=http%3A%2F%2Fgoogle.com" data-onendinteraction="myCallback">Share on G+</a>

function start() {
// 2. Initialize the JavaScript client library.
  gapi.client.init({
  'apiKey': 'AIzaSyDDKX8UqKihNrjKYTt7DyiGNDSt-hC9src',
  // Your API key will be automatically added to the Discovery Document URLs.
  'discoveryDocs': ['https://people.googleapis.com/$discovery/rest'],
  // clientId and scope are optional if auth is not required.
  'clientId': '827352255313-h87u38in8jk064eduj5dhuk8h7qvcmng.apps.googleusercontent.com',
  'scope': 'profile',
  }).then(function() {
  // 3. Initialize and make the API request.
  return gapi.client.people.people.get({
  'resourceName': 'people/me',
  'requestMask.includeField': 'person.names'
  });
  }).then(function(response) {
  console.log(response.result);
  }, function(reason) {
  console.log('Error: ' + reason.result.error.message);
  });
};
// 1. Load the JavaScript client library.
function loadBTN(){
  gapi.load('client', start);	
  gapi.plusone.render("mybutton",{
    callback:function(jsonParam) {alert("URL: ");}
  });
}
function myCallback(jsonParam) {
  alert("URL: ");
}

You can say I'm pointing my finger at the sky. None of the alerts fire.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question