M
M
Maxon2014-11-13 22:40:16
JavaScript
Maxon, 2014-11-13 22:40:16

How does Vkontakte sharing work?

Problem:
There are several articles on the site page, each with its own Vkontakte sharing button. It is necessary that when it is pressed, all the fields of the "Share with friends" window are filled with what I need. Actually substitute your link, title, description and picture, depending on the article to which the button belongs. I figured out the principle of its operation, you just need to pass these parameters with the necessary settings, tobish in:

VK.Share.button({
  url: 'http://mysite.com',
  title: 'Хороший сайт',
  description: 'Это мой собственный сайт, я его очень долго делал',
  image: 'http://mysite.com/mypic.jpg',
  noparse: true
}, {type: 'link'});

substitute your values. Actually, this is what I do, but when the button is pressed, all information in these fields is pulled from the page indicated in the link, and everything that I entered is ignored. It turns out like this: I
4ec18c3aa3a34432874a29b8a4aab5e7.png
installed everything according to the documentation: https://vk.com/dev/share_details
Question:
What's the problem? I do all this from a local server, but I don’t think that this can interfere with passing header parameters, etc. Especially since the link is transmitted as it should.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Platon Fedorovich, 2015-09-22
@platon_fedorovich

Try to do it with this project https://github.com/enjoyiacm/goodshare.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question