One of the clients needed to insert bookmarks odnknopka.ru to the top of the page. The problem is that the script from this resource is loaded for quite a long time (from 0.5 s and more), respectively, blocks further content loading. The user sees the cap and nothing more during this time.
You need to transfer this script to post-loading!
Here another problem appears: in the js code, the advanced content generation method document.write is used. Therefore, if you simply append the script after loading the main content, then apart from the bookmarks themselves, nothing else on the page will exist.
So I had to override the function ... document.write:
document._write = document.write; document.write = function (html) { if (html.indexOf("odnaknopka") != -1) { $("#xxx").append(html); return; } document._write(html); } $(document).ready(function() { $("#xxx").append('<script src="http://odnaknopka.ru/ok3.js" type="text/javascript"><' + '/script>'); });