Updating information in the Vkontakte like button

There's a page. When you first load AJAX'Ohm fill in all necessary data and initializes VK.Share.button. Further information is updated, and information sharing support information button is the one that was at the initialization.

In connection with this question: how can the initialization is over? Wonderful — with the help of some call call Facebook. Or completely kill all scripts are initialized with the contents of the re-initialization.

The scheme of work is the test page:
div class="..." onclick="return VK.Share.click(0, this);">img src="somepicrure.png" alt="">/div> — by clicking on this custom layer is called window sharing

div id="vk_share_button">1/div> — an invisible button. It shiring scripts Vkontakte fill all of its parameters.

vk_delay function() {<br> $(document).ready(function() {<br> // get some parameters from the page<br> document.getElementById('vk_share_button').innerHTML = VK.Share.button({<br> url: "link with parameters"+temp+temp2<br> title: ""+temp+temp2+""<br> description: "...",<br> image: '...',<br> noparse: 'true'<br> },{<br> type: "button",<br> text: "Save",<br> title: "..."<br> });<br> });<br> <br / > }<br> <br / > create_vk function() { setTimeout("vk_delay()", 1000); } // nostalchic, because VK is initialized before the ajax display data on the page<br> create_vk();

Problem: somehow in parallel with the ajax update refresh button sharing the new values of temp and temp2

Smoking manuals nothing. Call the function again draw the button to anything did not lead, as pre-treatment of the layer's contents vk_share_button.
October 8th 19 at 03:45
1 answer
October 8th 19 at 03:47
The issue is not solved yet. Another variant of the spike-solution: insert linocnoou on a separate page and display the iframe. When the ajax update to cause a reload of the iframe. But the solution is horrible spike and creates problems with layers, the application layers on top caused by the iframe

Find more questions by tags VKontakteJavaScript