Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from mathiasbynens/master

Asynchronous script loading: tweak how id is set
  • Loading branch information...
commit 4f5c65aa4d34784a3ef9eef03911305900b152e7 2 parents 35734fe + 364f4d1
@necolas necolas authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 async-script-loading/async-script-loading.js
View
4 async-script-loading/async-script-loading.js
@@ -14,10 +14,10 @@
fjs = doc.getElementsByTagName(script)[0],
frag = doc.createDocumentFragment(),
add = function(url, id) {
- if (doc.getElementById(id)) {return;}
+ if (doc.getElementById(id)) { return; }
js = doc.createElement(script);
js.src = url;
- js.id = id || null;
+ id && (js.id = id);
frag.appendChild(js);
};
Please sign in to comment.
Something went wrong with that request. Please try again.