Replace pattern (script at bottom)
Inline script just before the </body>
does not block most of the rendering of the page. This demo loads the script (it has some document.write()
inside of it) at the bottom, then replaces it with a block in the middle of context.
Sample
Codes
<div id="gist"></div>
...
<div id="gist-hide" style="display:none; visibility:hidden">
<script src="https://gist.github.com/..."></script>
</div>
<script>
var id = 'gist',
src = document.getElementById(id + '-hide'),
dst = document.getElementById(id);
dst.parentNode.replaceChild(src, dst);
src.style.cssText = 'display: block; visibility: visible';
</script>
</body>