javascript 页面标题中的“use.typekit.net”是做什么的?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27010834/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is "use.typekit.net" doing in the header of a page?
提问by Samantha J T Star
I am looking at this page.
我正在看这个页面。
I can see this in the header. Can someone explain what it does. I can't see any mention of it and what it is used for:
我可以在标题中看到这一点。有人可以解释一下它的作用。我看不到任何提及它以及它的用途:
<script class="js-allow-in-head" src="//use.typekit.net/txx2jfv.js"></script>
<script class="js-allow-in-head">try{Typekit.load();}catch(e){}</script>
thanks
谢谢
回答by Jon Snow
Typekitis a provider of webfonts. They probably are the only service that benefits from having the script in the head, because it blocks rendering while the fonts download, thus preventing a FOUT (flash of unstyled text)
Typekit是webfonts的提供者。它们可能是唯一受益于将脚本置于头部的服务,因为它会在字体下载时阻止渲染,从而防止FOUT(无样式文本的闪烁)
The script works by fetching some css files that contain the fonts in base64 encoding.
该脚本通过获取一些包含 base64 编码字体的 css 文件来工作。
回答by Ankit Chugh
//use.typekit.net/txx2jfv.js is the script including in the header of page..this file contain some jquery code...The use of that code is to use beautiful FONTS on your page...check the site https://typekit.com/
//use.typekit.net/txx2jfv.js 是包含在页面头部的脚本..这个文件包含一些jquery代码......该代码的用途是在你的页面上使用漂亮的字体......检查网站https://typekit.com/