Skip to content

Instantly share code, notes, and snippets.

@markpasc
Forked from capndesign/typekit-colophon.js
Created November 12, 2010 22:38
Show Gist options
  • Save markpasc/674826 to your computer and use it in GitHub Desktop.
Save markpasc/674826 to your computer and use it in GitHub Desktop.
javascript:s=document.createElement('script');s.type='text/javascript';s.src='https://gist.github.com/raw/674826/typekit-colophon.js';document.getElementsByTagName('head').item(0).appendChild(s);void('')
function findTypekit() {
var a = document.getElementsByTagName('script');
var y = '';
for (var i = 0; i < (a.length - 1); i++) {
var x = a[i].getAttribute('src');
if (x) {
if (x.search('use.typekit.com') >= 1) {
y = 'http://typekit.com/colophons/' + x.substring(23,30);
};
};
};
if (y != '') {
window.location.assign(y);
} else {
void(y);
alert('This site doesn\'t use Typekit!');
};
}
findTypekit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment