Skip to content

Instantly share code, notes, and snippets.

@gbertb
Created March 12, 2014 06:40
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save gbertb/9502005 to your computer and use it in GitHub Desktop.
Save gbertb/9502005 to your computer and use it in GitHub Desktop.
How to load Font Awesome asynchronously
<!--
How to load Font Awesome asynchronously
Use: Just put this script on the bottom/footer of your web
-->
<script type="text/javascript">
(function() {
var css = document.createElement('link');
css.href = '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css';
css.rel = 'stylesheet';
css.type = 'text/css';
document.getElementsByTagName('head')[0].appendChild(css);
})();
</script>
@rohitink
Copy link

rohitink commented Dec 9, 2017

Awsome :)

@wiBlogger
Copy link

Really ?
You do not need any script for putting font awesome at the bottom

@hsingh23
Copy link

hsingh23 commented Feb 7, 2018

what about reserving some space for the font awesome icon so the page doesn't jump around?

@ahmed-sheta
Copy link

Good Script .. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment