D
D
Dos7712015-11-20 08:06:41
JavaScript
Dos771, 2015-11-20 08:06:41

How can I create a function on the twitter, google, facebook share button?

Good morning everyone, please help me out, the problem is: I need to add social network buttons to the site, and assign a callback function so that when a person clicks on the button to share a link, after clicking on the button, JS code should work for me, for example alert(" Thank you for sharing the link" ); It is the code that should work then, after the person has shared the link.
Vkontakte I was able to do, but the rest of the social. networking is very difficult to do because the documentation is in English. Facebook, Twitter, Google Plus.
Here is an example code in contact.

<div id="vk_like"></div>
<script type="text/javascript">
window.onload = function () {
 VK.init({apiId: 5144798, onlyWidgets: true});
 VK.Widgets.Like('vk_like', {type: 'button'}, 457);
 VK.Observer.subscribe("widgets.like.shared", function f(){ $("button").show('slow')}); Вот та самая строка когда срабатывает JavaScript.
}
</script>

Thank you very much in advance.

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