Search code examples
javascriptcsshtmlcorsgoogle-font-api

CORS and 'access control allow origin' error while using prefixfree.js and google fonts api


I am getting errors related to CORS and ACAO. Working on html5 responsive website tutorial and just added the basic files which are needed to create the website as described in tut. Here are the screenshots.

enter image description here enter image description here


Solution

  • Solution to problem # 1 First issue of CORS was resolved by using httml server locally as suggested by @destroy.

    Solution to problem #2 Just add prefetch after stylesheet to rel.

    <link title="fonts" href="http://fonts.googleapis.com/..." rel="stylesheet prefetch" type="text/css" />
    

    source : http://www.raymonschouwenaar.nl/google-webfont-issue-xmlhttprequest-cannot-load/