Created
March 11, 2013 11:07
-
-
Save anselmh/5133497 to your computer and use it in GitHub Desktop.
This snippet loads webfonts (in this case from Google Webfonts) asynchronously. This means it does not block page load but also means it can cause FOUT.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebFontConfig = { | |
google: { families: [ 'Istok+Web:400,700:latin' , 'Lora:400,700:latin' ] } | |
}; | |
(function() { | |
var wf = document.createElement('script'); | |
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; | |
wf.type = 'text/javascript'; | |
wf.async = 'true'; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(wf, s); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment