Load CSS asynchronously

loadCSS is Js function which loads CSS asynchronously.

Usage

Include the loadCSS JavaScript file in the document or add it inline, then call it by passing it a stylesheet URL, for e.g.

<head>
...
<script>
  // include loadCSS here...
  function loadCSS( href, before, media ){ ... }
  // load a file
  loadCSS( "path/to/mystylesheet.css" );
</script>
<noscript><link href="path/to/mystylesheet.css" rel="stylesheet"></noscript>
...
</head>
Github
License MIT