<a href="https://twitter.com/share" class="twitter-share-button" data-lang="ru"></a>
<script> !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<div id="fb-root"></div>
<script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/ru_RU/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>
<!-- Place this tag where you want the +1 button to render. --> <div class="g-plusone" data-annotation="none"></div>
<!-- Place this tag after the last +1 button tag. --> <script type="text/javascript"> window.___gcfg = {lang: 'ru'}; (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script>
<!-- Put this script tag to the <head> of your page --> <script type="text/javascript" src="//vk.com/js/api/openapi.js?75"></script> <script type="text/javascript"> VK.init({apiId: 3363525, onlyWidgets: true}); </script>
<!-- Put this div tag to the place, where the Like block will be --> <div id="vk_like"></div>
<script type="text/javascript"> VK.Widgets.Like("vk_like", {type: "button"}); </script>
<div class="g-plusone" data-annotation="none"></div>
document.getElementById(id).dataset.annotation = "none"
document.getElementById(id).setAttribute("data-annotation", "none");
, why they do not understand that someone else does not know about them? Or search engine rankings are small? In general, I wrote it this way:
, you can, of course, put rel = "nofollow", but I chose the most radical method. Generally would remove the tag "A", but without it does not work. HTML block of buttons, paste where you want to see the buttons: <ul style="height:40px;list-style:none;margin:0;padding:0;"> <li style="float:left;"> <a id="s-twitter" class="twitter-share-button"> </a></li> <li style="float:left;"> <div id="s-facebook" class="fb-like" style="margin-right:40px;"> </div> </li> <li style="float:left;"> <div id="vk_like"> </div> </li> <li style="float:left;margin-right:10px;"> <div id="s-google" class="g-plusone"> </div> </li> </ul>
<script type="text/javascript"> (function() { function async_load(u,id) { if (!gid(id)) { s="script", d=document, o = d.createElement(s); o.type = 'text/javascript'; o.id = id; o.async = true; o.src = u; // Creating scripts on page x = d.getElementsByTagName(s)[0]; x.parentNode.insertBefore(o,x); } } function gid (id){ return document.getElementById(id); } window.onload = function() { e = gid("s-twitter"); e.setAttribute("data-lang", "ru"); e = gid("s-facebook"); e.setAttribute("data-layout", "button_count"); e.setAttribute("data-send", "false"); e = gid("s-google"); e.setAttribute("data-size", "medium"); async_load("//platform.twitter.com/widgets.js", "id-twitter");//twitter async_load("//connect.facebook.net/ru_RU/all.js#xfbml=1", "id-facebook");//facebook async_load("https://apis.google.com/js/plusone.js", "id-google");//google async_load("//vk.com/js/api/openapi.js", "id-vkontakte");//vkontakte }; // vkontakte window.vkAsyncInit = function(){ VK.init({apiId: 3363525, onlyWidgets: true}); VK.Widgets.Like("vk_like", {type: "button", height: 20}); }; })(); </script>
Source: https://habr.com/ru/post/166831/
All Articles