[英]Access-Control-Allow-Origin error in Chrome
Got this in Chrome dev console:在 Chrome 开发控制台中得到这个:
Font from origin ' http://cdnjs.cloudflare.com ' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
跨源资源共享策略已阻止加载来自源“ http://cdnjs.cloudflare.com ”的字体:请求的资源上不存在“Access-Control-Allow-Origin”标头。 Origin ' http://xx.xx.xx.xx:8000 ' is therefore not allowed access.
因此,不允许访问源“ http://xx.xx.xx.xx:8000 ”。
However, I did this:但是,我这样做了:
curl -I http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/fonts/fontawesome-webfont.ttf?v=4.2.0
HTTP/1.1 200 OK
Date: Thu, 11 Dec 2014 15:51:47 GMT
Content-Type: application/font-sfnt
Content-Length: 112160
Connection: keep-alive
Last-Modified: Thu, 28 Aug 2014 04:30:29 GMT
Expires: Tue, 01 Dec 2015 15:51:47 GMT
Cache-Control: public, max-age=30672000
Access-Control-Allow-Origin: *
So what's going on??发生什么了??
EDITED Oh never mind, I resolved it by using https:
instead of just //
..编辑哦,没关系,我通过使用
https:
而不是//
..
我通过使用 https: 而不仅仅是 // ..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.