1

I'm trying to import fonts from googleapis but for some reason I get the following console error on all of the fonts:

Font from origin 'https://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. Origin 'https://mkhosting.kohlercoding.dk' is therefore not allowed access. The response had HTTP status code 404.

I've looked trough other posts about this on here and nothing helped. Here's my header:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>MKHosting</title>
        <link rel="icon" type="image/png" href="/favicon.png" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
        <link rel="shortcut icon" type="image/png" href="/favicon.png" />
        <!-- <meta http-equiv="refresh" content="0;URL=https://kohlercoding.dk/login-sys/login.php"> -->
        <!-- FontAwesome -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
        <!--Import Google Icon Font-->
        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
        <!-- Compiled and minified CSS -->
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css">
        <!-- jQuery -->
        <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
        <!-- Active Menu Script -->
        <script src="/assets/js/activemenu.jquery.js"></script>
        <!-- SmoothScroll Script -->
        <script src="/assets/js/smoothscroll-jquery.min.js"></script>
        <!-- Compiled and minified JavaScript -->
        <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/js/materialize.min.js"></script>
        <!-- CSS -->
        <link rel="stylesheet" href="assets/css/style.css">
        <!-- Initialize Materialize Scripts -->
        <script>$(document).ready(function(){
    $(".button-collapse").sideNav();
    $('.parallax').parallax();
    $(".dropdown-button").dropdown({
        hover: false
    });
});</script>
</head>
Mikkel
  • 50
  • 1
  • 9
  • Possible duplicate of [How can I fix the 'Missing Cross-Origin Resource Sharing (CORS) Response Header' webfont issue?](http://stackoverflow.com/questions/27009425/how-can-i-fix-the-missing-cross-origin-resource-sharing-cors-response-header) – Croises Apr 08 '16 at 09:46

1 Answers1

0

Found out that it was MaterializeCSS that apparently was the problem and they had a bug with their newest update so downgrading one version fixed the problem.

Mikkel
  • 50
  • 1
  • 9