S
S
slavok17322015-09-26 17:04:50
JavaScript
slavok1732, 2015-09-26 17:04:50

How to install Vk.Share.Button? Why doesn't the noparse option work?

Hello, the essence of the problem is that I need a custom "share" button on the site. Tried doing it like this:

document.write(VK.Share.button({
url: "http://x/content_page.php?&i=4&e=1",
title: "Tiiitle",
description: "Deeeescription",
image: "http://x/images_content-page/Start.jpg",
noparse: true
}, {
type: "custom",
text: "html code is ok"
}));

BUT the noparse option just didn't work. Description, title, pictures - everything worked according to the noparse: false scenario.
Then I googled this script of actions:
document.write(VK.Share.button({
url:  "http://x/content_page.php?i=4&e=1&title=blablabla&description=desc&image=path&noparse=true"
}, {
type:  "custom",
text:  "html code is ok"
}));

But a small problem still remains...
People share a link like content_page.php?i=4 instead of content_page.php?i=4&e=1. How do I escape the & symbol so that people follow the link I want?
And here is the second problem of this method: how can I support Russian text in the title, description, image path? - Solved with urlencode (php).

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