Skip to content

Instantly share code, notes, and snippets.

@ghooghe
Forked from scottjehl/loadicons.html
Created September 23, 2015 18:28
Show Gist options
  • Save ghooghe/c0eac825ffec9e8983f8 to your computer and use it in GitHub Desktop.
Save ghooghe/c0eac825ffec9e8983f8 to your computer and use it in GitHub Desktop.
load the icons
<head>
...
...
<script>
// async-load a stylesheet full of data-uri'd icons...
(function( href ){
links = document.getElementsByTagName( "link" ),
elem = document.createElement( "link" ),
ref = links[ links.length ];
elem.href = href;
elem.rel = "stylesheet";
ref.parentNode.insertBefore( elem, ref );
}( "css/icons.css" ));
</script>
<noscript>
<link href="css/icons.css" rel="stylesheet">
</noscript>
...
</head>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment