Answer the question
In order to leave comments, you need to log in
Problems with VK share button. There is a picture in the sharing popup window, but after sending it to the VK website, the picture is gone. How to fix it?
Good afternoon!
On the site page there are many elements of the same type, with different content, and with buttons - share VKontakte.
The values that will be transmitted to the Vk website when you click on the "share" button are different. When you click on the button, a dialog box opens successfully with a generated message for VK. Everything is in its place, and the picture, and description and url.
However, after sending, there is no picture on the page in VK, only a description and a link
I want to note that the picture is not on the site where the button is located. Also, when debugging the script, if there was an error in the image address, in the sharing dialog box it was possible to select images that are on the site. How these images were selected, I did not understand. So I was asked to choose from 14 pictures, and no matter what I did, the pictures did not change and their number remained unchanged. But these pictures were published without problems in VK.
I tried to use images from the same site where the buttons were located, but the result remained the same. I also tried to clear the cache through pages.clearCache to no avail.
Here is how it is implemented on the site:
Button:
<i class="fa fa-vk"
onclick="vkShare('sodapoppin','2','sodapoppin',
'http://static-cdn.jtvnw.net/previews-ttv/live_user_sodapoppin-320x180.jpg',
encodeURIComponent('Legion Beta stuff @Sodapoppintv'))"> </i>
function vkShare(streamId,providerId, ptitle, pimg, text)
{
url = 'http://vkontakte.ru/share.php?';
url += 'url=' + encodeURIComponent( "http://" + $(location).attr('host') + "/?popStreamId=" + streamId + "&popProviderId=" + providerId + "&popChannel=" + streamId);
url += '&title=' + encodeURIComponent(ptitle);
url += '&description='+text;
url += '&image='+encodeURIComponent(pimg); //Вот тут я передаю адрес картинки
url += '&noparse=false';
popup(url);
}
function popup(url) {
window.open(url, '', 'toolbar=0,status=0,width=626,height=436');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question