类似Facebook&;从引导加载字体时出现CORS错误';s cdn 设置:
基于此,我们在服务器上实施了以下修复程序:类似Facebook&;从引导加载字体时出现CORS错误';s cdn 设置:,facebook,twitter-bootstrap,cors,Facebook,Twitter Bootstrap,Cors,基于此,我们在服务器上实施了以下修复程序: 因此,我尝试使用javascript,如这里所述:并更新了问题。在Firefox中,我在Facebooklike.php脚本中遇到了SHA1错误(但不是CORS错误)。 # ALLOW CROSS DOMAIN FONTS # ----------------------------------------------------------------------- # Allow access from all domains for webfon
因此,我尝试使用javascript,如这里所述:并更新了问题。在Firefox中,我在Facebook
like.php
脚本中遇到了SHA1错误(但不是CORS错误)。
# ALLOW CROSS DOMAIN FONTS
# -----------------------------------------------------------------------
# Allow access from all domains for webfonts.
# Alternatively you could only whitelist your
# subdomains like "subdomain.example.com".
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
<script>
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
var invocation = new XMLHttpRequest();
var url = 'http://netdna.bootstrapcdn.com/font-awesome/';
function callOtherDomain() {
if(invocation) {
invocation.open('GET', url, true);
invocation.onreadystatechange = handler;
invocation.send();
}
}
</script>