Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@rohitink rohitink commented Dec 9, 2017

Awsome :)

@wiBlogger

This comment has been minimized.

Copy link

@wiBlogger wiBlogger commented Jan 19, 2018

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

@hsingh23

This comment has been minimized.

Copy link

@hsingh23 hsingh23 commented Feb 7, 2018

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

@ahmed-sheta

This comment has been minimized.

Copy link

@ahmed-sheta ahmed-sheta commented Oct 22, 2019

Good Script .. Thanks

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