11

I'm trying to use a google font 'Oswald'. When i embed it into my page in the recommended way:

<link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'>

Chrome throws the following error:

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. 

Is this just a mistake on google's part or am i doing something wrong?

2

1 Answer 1

25

Turns out it was a conflict with prefixfree

Solution was to add "data-noprefix" to the link tag, like so:

<link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css' data-noprefix>
3
  • Thanks, but i have had issues with // in the past in some browsers. If the site does not have an SSL certificate, i don't see why this matters.
    – deweydb
    Sep 15, 2014 at 22:43
  • no it does not but it means you can't install an SSL without it causing an notification
    – Barkermn01
    Sep 16, 2014 at 9:52
  • 1
    I added the 'data-noprefix' but am still getting the error. Jul 7, 2016 at 23:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.