I
I
Ivan95Serj2019-07-31 16:54:48
JavaScript
Ivan95Serj, 2019-07-31 16:54:48

Introduce share-buttons of social networks?

It is necessary to introduce the possibility of publishing in social networks through the site. I tried, for example, the following in VK:

url  = 'http://vk.com/share.php?';
        url += 'url='          + encodeURIComponent('mysite.com');
        url += '&title='       + encodeURIComponent('title');
        url += '&description=' + encodeURIComponent('description');
        url += '&noparse=true';
        window.open(url,'','toolbar=0,status=0,width=626,height=436');

But I came across the fact that the comment section of the post (in the popup) is not filled from the description field. Plus, in the popup itself, the button to tell friends on the page does not work, but that moment works if you send the entry by private message .
I tried the option from the VK docks, the problems are identical:
<script type="text/javascript" src="https://vk.com/js/api/share.js?93" charset="windows-1251"></script>
<script type="text/javascript">
...
document.write(VK.Share.button({
  url: 'http://mysite.com',
  title: 'Заголовок страницы',
  image: 'http://mysite.com/mypic.jpg',
  noparse: true
}));

Is there any ready-made basic template for sharing in social networks (without downloading packages in npm)?
I need vk, fb, twitter.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Filippov, 2019-07-31
@Webram

Why not use a search engine ?
There are many different services on this topic.

A
Anatoly Kulikov, 2019-07-31
@anatoly_kulikov

You can use this turnip .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question