Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Loading multiple 3rd party widgets asynchronously
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);
Copy link

kimmykuang commented Dec 11, 2014

i think pass 'document' into scope is better

Copy link

fer-ri commented May 15, 2015

Nice 👍


ty babe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment