Browse files

Merge pull request #1 from mathiasbynens/master

Asynchronous script loading: tweak how id is set
  • Loading branch information...
2 parents 35734fe + 364f4d1 commit 4f5c65aa4d34784a3ef9eef03911305900b152e7 @necolas necolas committed Oct 20, 2011
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);
};

0 comments on commit 4f5c65a

Please sign in to comment.