S
S
sh1ftyshmifty2015-11-10 10:39:43
JavaScript
sh1ftyshmifty, 2015-11-10 10:39:43

How to fix the error of duplicating the Vkontakte widget?

Comrades, help solve the problem with VKontakte group widgets.
I don’t understand for what reason, but the VKontakte widget is duplicated.
https://yadi.sk/i/l144S0bFkMDFV
UPD : Script

<script type="text/javascript" src="//vk.com/js/api/openapi.js?120"></script>
connected in the header
<div class="arcticmodal-container"><table class="arcticmodal-container_i"><tbody><tr><td class="arcticmodal-container_i2"><div class="box-modal" id="boxUserFirstInfo">
    
    <div><span class="am-title">Подписывайтесь, чтобы следить за нами во Вконтакте!</span></div>
    <div id="vk_groups" style="height: 250px; width: 300px; background: none;"><script type="text/javascript" src="//vk.com/js/api/openapi.js?120"></script>

<!-- VK Widget -->
<div id="vk_groups"></div>
<script type="text/javascript">
VK.Widgets.Group("vk_groups", {mode: 0, width: "300", height: "250", color1: 'FFFFFF', color2: '2B587A', color3: '5B7FA6'}, 78010869);
</script></div><div>
 
  <div class="am-blocks">
   <div class="header">Вас ждут:</div>
    <i class="fa fa-2x fa-newspaper-o"></i><br>Интересные новости
  </div>
  <div class="am-blocks">
  <i class="fa fa-2x fa-thumbs-o-up"></i><br>
  Полезные<br>советы  </div>
  <div class="am-blocks">
    <i class="fa fa-2x fa-money"></i><br>Купоны<br>на скидки</div>
  <div class="am-blocks">
    <i class="fa fa-2x fa-gift"></i><br>Розыгрыш<br>призов</div>
</div>
<br><div class="box-modal_close arcticmodal-close">Спасибо, я уже с вами!</div>


  </div></td></tr></tbody></table></div>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Gromadchuk, 2015-11-10
@Gromadchuk

I would like to note your repetition id="vk_groups", which is a gross mistake.
Of course, because of this, you may have problems, since the VKontakte function tries to access an element with an id that is equal to vk_groups. But due to the fact that you have two of them, your code may not work correctly.
e60c8523fe224120ad1e9a1ca6914eaf.png

M
Mikhail, 2015-11-10
Chirskiy @chirskiy_mixail

I copied your code and checked in Fiddle
jsfiddle.net/w13au2a4 there is no duplication, your problem is in another place, most likely it was previously connected somewhere. and forgot to remove, well, these are assumptions)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question