@newaitix

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: ");
}

Можно сказать тыкаю пальцем в небо. Ни один из alert не срабатывает.
  • Вопрос задан
  • 69 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
summer Ярославль
от 100 000 до 140 000 ₽
КРАФТТЕК Санкт-Петербург
от 60 000 до 80 000 ₽
18 апр. 2024, в 21:56
2000 руб./за проект
18 апр. 2024, в 21:00
150 руб./за проект