The translation was generated automatically and may contain mistakes
Article 1
With this widget, you will be able to place on your website articles created by the VKontakte> Different materials, decorated in a single style, will become the decoration of the site. These can be options for entertainment programs, customer reviews, terms of cooperation — everything that is necessary for your tasks.
To open the article, visitors will not have to leave your resource. Loading this material will take only a moment — often much faster than the transition to a new page.
Widget connection
To add a widget to your site, follow these steps:
Step 1. In the tag <head> On your website, add a link. openapi.js :
<script src="https://vk.com/js/api/openapi.js?169" type="text/javascript"></script>Add an element to the body of the page <div> , which will display comments, give it a unique id, and add a widget initialization code to it. For example:
<div id="my_article"></div>
<script type="text/javascript">
VK.Widgets.Article('my_article', '@thevyshka-perezhivaem-stress-pravilno');
</script>If your website is already in use Open API , adding a widget is even easier. Simply add widget initialization.
Additional settings
Widget creation method VK.Widgets.Article It takes two parameters:
- •
element_id(string), the mandatory parameter is the id of the element that will be the button container for communication. Our default constructor uses a value"vk_article_" + {owner_id} + {article_id}. - •
article_url(string), a mandatory parameter is the address of the article.
Example of use
<script type="text/javascript" src="//vk.com/js/api/openapi.js?157"></script>
<span class="wk_comment"> VK Widget </span>
<div id="vk_article_-66036248_15"></div>
<script type="text/javascript">
VK.Widgets.Article('vk_article_-66036248_15', '@thevyshka-perezhivaem-stress-pravilno');
</script>Код виджета
To add a widget to your site, simply copy the code to paste to the page you want to place the widget on.