Skip to content

Instantly share code, notes, and snippets.

@peterwilsoncc
Last active December 31, 2015 21:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterwilsoncc/8049559 to your computer and use it in GitHub Desktop.
Save peterwilsoncc/8049559 to your computer and use it in GitHub Desktop.
Typekit async code
(function(P,W,C,c){
var t={kitId:'xow3svv',scriptTimeout:3000},
y=P.documentElement,p=P.createElement(W),e=false,k=P.getElementsByTagName(W)[0],i,T=setTimeout(function(){y[C]=y[C].replace(/\bwf-loading\b/g,'')+c+"inactive"},t.scriptTimeout);y[C]+=c+"loading";p.src='//use.typekit.net/'+t.kitId+'.js';p.onload=p.onreadystatechange=function(){i=this.readyState;if(e||i&&i!="complete"&&i!="loaded")return;e=true;clearTimeout(T);try{Typekit.load(t)}catch(x){}};k.parentNode.insertBefore(p,k)})(document,'script','className',' wf-');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment