Google字体给出:请求的资源上不存在“Access-Control-Allow-Origin”标头 [英] Google Fonts giving: No 'Access-Control-Allow-Origin' header is present on the requested resource
问题描述
< link href ='http://fonts.googleapis.com/css?family = Oswald:400,300,700'rel ='stylesheet'类型= '文本/ CSS' > Chrome会抛出以下错误:
$ b $ p> XMLHttpRequest无法加载http://fonts.googleapis.com/css?family=Oswald:400,300,700。请求的资源上没有Access-Control-Allow-Origin标题。原因'http://<<< redacted>>'因此不被允许访问。
这只是Google的错误吗?或者我做错了什么?
原来这是与 prefixfree 解决方法是将data-noprefix添加到链接标记,如下所示: I'm trying to use a google font 'Oswald'. When i embed it into my page in the recommended way: Chrome throws the following error: Is this just a mistake on google's part or am i doing something wrong? Turns out it was a conflict with prefixfree Solution was to add "data-noprefix" to the link tag, like so:
这篇关于Google字体给出:请求的资源上不存在“Access-Control-Allow-Origin”标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
< link href ='http://fonts.googleapis.com/css?family = Oswald:400,300,700'rel ='stylesheet'type ='text / css'data-noprefix>
<link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'>
XMLHttpRequest cannot load http://fonts.googleapis.com/css?family=Oswald:400,300,700. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://<<redacted>>' is therefore not allowed access.
<link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css' data-noprefix>