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?

deweydb
  • 2,238
  • 2
  • 30
  • 37
  • By the way, you shouldn't use ' to delimit argument values in HTML tags. It's not standard, and it's simply wrong. – ItalyPaleAle Sep 15 '14 at 21:03
  • 3
    @Qualcuno uh, thanks, but that was copied directly from the Google Fonts page. https://www.google.com/fonts#UsePlace:use/Collection:Oswald – deweydb Sep 15 '14 at 22:42

1 Answers1

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>
deweydb
  • 2,238
  • 2
  • 30
  • 37