Load a script file asynchronously
Loading an external script asynchronously is simple. Create a script tag, set its
src attribute, and inject it into the DOM tree:
var script = document.createElement('script'),
scripts = document.getElementsByTagName('script');
script.src = url;
defer) attribute included:
<script src="https://platform.twitter.com/widgets.js" async defer></script>
The HTML5 attribute
async tells the browser to load this script without blocking the page.
defer does essentially the same, but works on several older browsers, too.