Page 1 of 1

Cross-Site Stuff

Posted: Sun Mar 31, 2013 1:59 am
by FrederickGeek8
When using Google Fonts in a website, in the Error section of the Developer Tools in Safari, I get this error
XMLHttpRequest cannot load http://fonts.googleapis.com/css?family= ... ather+Sans. Origin <current-url> is not allowed by Access-Control-Allow-Origin.
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.

Re: Cross-Site Stuff

Posted: Thu Apr 18, 2013 4:04 pm
by Anchimayen
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. :)

Re: Cross-Site Stuff

Posted: Wed May 08, 2013 2:00 am
by FrederickGeek8
Thats what I have been doing :? Adding the @import instead into the CSS file works though.