Load CSS asynchronously

loadCSS is Js function which loads CSS asynchronously.


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

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