When using Google Fonts in a website, in the Error section of the Developer Tools in Safari, I get this error
[syntax=text]XMLHttpRequest cannot load http://fonts.googleapis.com/css?family= ... ather+Sans. Origin <current-url> is not allowed by Access-Control-Allow-Origin.[/syntax]
Now I looked it up and people are saying it is a cross-site scripting related error. I also found this article where it goes over ways to prevent this error. Unfortunately all of these techniques require javascript/ajax and I don't really want want to make the site any slower.
Basically my question is, do you guys know any other ways such as special HTML tags, etc that will disable cross-site scripting checks or allow this to happen? Right now I am able to fix it by adding a @import in the CSS instead of using the <link> tag.
Cross-Site Stuff
-
- Posts: 8
- Joined: Tue Apr 16, 2013 8:32 am
Re: Cross-Site Stuff
This is how i did it: <link href='http://fonts.googleapis.com/css?family=Josefin+Slab:300' rel='stylesheet' type='text/css'> (this in the HTML-file). I don't know if it helps you, but it works for me all the time.
- FrederickGeek8
- Posts: 148
- Joined: Wed Nov 30, 2011 10:31 pm
Re: Cross-Site Stuff
Thats what I have been doing Adding the @import instead into the CSS file works though.