C
C
colddave2016-10-17 04:57:02
JavaScript
colddave, 2016-10-17 04:57:02

How to add a variable to a widget?

How can I add a variable to description?
https://vk.com/dev/share_details

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

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
riot26, 2016-10-17
@riot26

<script type="text/javascript">
var pageDescription = 'Это мой собственный сайт, я его очень долго делал. Меня зовут Вася';
document.write(VK.Share.button({
  url: 'http://mysite.com',
  title: 'Хороший сайт',
  description: pageDescription,
  image: 'http://mysite.com/mypic.jpg',
  noparse: true
}));
</script>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question