Skip to content

Instantly share code, notes, and snippets.

@iksi
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iksi/b506788f9c13dd47bc8c to your computer and use it in GitHub Desktop.
Save iksi/b506788f9c13dd47bc8c to your computer and use it in GitHub Desktop.
Load css file without blocking rendering.
(function (s) {
"use strict";
var e,
p;
// Load CSS
e = document.createElement("link");
p = document.getElementsByTagName("head")[0];
e.rel = "stylesheet";
e.href = s;
e.media = "only x";
p.appendChild(e);
setTimeout(function () {
e.media = "all";
});
}("all.css"));
// Minified:
(function(s){"use strict";var e,p;e=document.createElement("link");p=document.getElementsByTagName("head")[0];e.rel="stylesheet";e.href=s;e.media="only x";p.appendChild(e);setTimeout(function(){e.media="all";});}("all.css"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment